resourceQuota support for extended resources
This commit is contained in:
@@ -3998,6 +3998,10 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
|
||||
if !helper.IsStandardContainerResourceName(value) {
|
||||
return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource for containers"))
|
||||
}
|
||||
} else if !helper.IsDefaultNamespaceResource(core.ResourceName(value)) {
|
||||
if !helper.IsExtendedResourceName(core.ResourceName(value)) {
|
||||
return append(allErrs, field.Invalid(fldPath, value, "doesn't follow extended resource name standard"))
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
@@ -4179,7 +4183,8 @@ func ValidateLimitRange(limitRange *core.LimitRange) field.ErrorList {
|
||||
}
|
||||
}
|
||||
|
||||
// for GPU and hugepages, the default value and defaultRequest value must match if both are specified
|
||||
// for GPU, hugepages and other resources that are not allowed to overcommit,
|
||||
// the default value and defaultRequest value must match if both are specified
|
||||
if !helper.IsOvercommitAllowed(core.ResourceName(k)) && defaultQuantityFound && defaultRequestQuantityFound && defaultQuantity.Cmp(defaultRequestQuantity) != 0 {
|
||||
allErrs = append(allErrs, field.Invalid(idxPath.Child("defaultRequest").Key(string(k)), defaultRequestQuantity, fmt.Sprintf("default value %s must equal to defaultRequest value %s in %s", defaultQuantity.String(), defaultRequestQuantity.String(), k)))
|
||||
}
|
||||
|
Reference in New Issue
Block a user