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
c48e94df
Commit
c48e94df
authored
Feb 15, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20956 from derekwaynecarr/cleanup_validation
Auto commit by PR queue bot
parents
1380a3e6
cc2137fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
validation.go
pkg/api/validation/validation.go
+1
-9
No files found.
pkg/api/validation/validation.go
View file @
c48e94df
...
@@ -2233,15 +2233,7 @@ func ValidateResourceRequirements(requirements *api.ResourceRequirements, fldPat
...
@@ -2233,15 +2233,7 @@ func ValidateResourceRequirements(requirements *api.ResourceRequirements, fldPat
// Check that request <= limit.
// Check that request <= limit.
requestQuantity
,
exists
:=
requirements
.
Requests
[
resourceName
]
requestQuantity
,
exists
:=
requirements
.
Requests
[
resourceName
]
if
exists
{
if
exists
{
var
requestValue
,
limitValue
int64
if
quantity
.
Cmp
(
requestQuantity
)
<
0
{
requestValue
=
requestQuantity
.
Value
()
limitValue
=
quantity
.
Value
()
// Do a more precise comparison if possible (if the value won't overflow).
if
requestValue
<=
resource
.
MaxMilliValue
&&
limitValue
<=
resource
.
MaxMilliValue
{
requestValue
=
requestQuantity
.
MilliValue
()
limitValue
=
quantity
.
MilliValue
()
}
if
limitValue
<
requestValue
{
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
fldPath
,
quantity
.
String
(),
"must be greater than or equal to request"
))
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
fldPath
,
quantity
.
String
(),
"must be greater than or equal to request"
))
}
}
}
}
...
...
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