Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f7c4389b
Unverified
Commit
f7c4389b
authored
Feb 11, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73877 from droslean/nits
apis:core:validation: remove unused, changes to idiomatic go
parents
6912bbb1
c7e103fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
21 deletions
+2
-21
validation.go
pkg/apis/core/validation/validation.go
+2
-21
No files found.
pkg/apis/core/validation/validation.go
View file @
f7c4389b
...
...
@@ -2082,13 +2082,6 @@ func validateObjectFieldSelector(fs *core.ObjectFieldSelector, expressions *sets
return
allErrs
}
func
fsResourceIsEphemeralStorage
(
resource
string
)
bool
{
if
resource
==
"limits.ephemeral-storage"
||
resource
==
"requests.ephemeral-storage"
{
return
true
}
return
false
}
func
validateContainerResourceFieldSelector
(
fs
*
core
.
ResourceFieldSelector
,
expressions
*
sets
.
String
,
fldPath
*
field
.
Path
,
volume
bool
)
field
.
ErrorList
{
allErrs
:=
field
.
ErrorList
{}
...
...
@@ -4014,7 +4007,7 @@ func ValidateReadOnlyPersistentDisks(volumes []core.Volume, fldPath *field.Path)
vol
:=
&
volumes
[
i
]
idxPath
:=
fldPath
.
Index
(
i
)
if
vol
.
GCEPersistentDisk
!=
nil
{
if
vol
.
GCEPersistentDisk
.
ReadOnly
==
false
{
if
!
vol
.
GCEPersistentDisk
.
ReadOnly
{
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
idxPath
.
Child
(
"gcePersistentDisk"
,
"readOnly"
),
false
,
"must be true for replicated pods > 1; GCE PD can only be mounted on multiple machines if it is read-only"
))
}
}
...
...
@@ -4360,15 +4353,6 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
return
allErrs
}
// isLocalStorageResource checks whether the resource is local ephemeral storage
func
isLocalStorageResource
(
name
string
)
bool
{
if
name
==
string
(
core
.
ResourceEphemeralStorage
)
||
name
==
string
(
core
.
ResourceRequestsEphemeralStorage
)
||
name
==
string
(
core
.
ResourceLimitsEphemeralStorage
)
{
return
true
}
return
false
}
// Validate resource names that can go in a resource quota
// Refer to docs/design/resources.md for more details.
func
ValidateResourceQuotaResourceName
(
value
string
,
fldPath
*
field
.
Path
)
field
.
ErrorList
{
...
...
@@ -4975,10 +4959,7 @@ func ValidateNamespace(namespace *core.Namespace) field.ErrorList {
// Validate finalizer names
func
validateFinalizerName
(
stringValue
string
,
fldPath
*
field
.
Path
)
field
.
ErrorList
{
allErrs
:=
apimachineryvalidation
.
ValidateFinalizerName
(
stringValue
,
fldPath
)
for
_
,
err
:=
range
validateKubeFinalizerName
(
stringValue
,
fldPath
)
{
allErrs
=
append
(
allErrs
,
err
)
}
allErrs
=
append
(
allErrs
,
validateKubeFinalizerName
(
stringValue
,
fldPath
)
...
)
return
allErrs
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment