Fix validation of resources (cpu, memory, storage) for limit range types.

This commit is contained in:
Avesh Agarwal
2016-03-09 18:11:26 -05:00
parent af2f003585
commit 427774306c
3 changed files with 97 additions and 5 deletions

View File

@@ -127,6 +127,16 @@ func IsStandardContainerResourceName(str string) bool {
return standardContainerResources.Has(str)
}
var standardLimitRangeTypes = sets.NewString(
string(LimitTypePod),
string(LimitTypeContainer),
)
// IsStandardLimitRangeType returns true if the type is Pod or Container
func IsStandardLimitRangeType(str string) bool {
return standardLimitRangeTypes.Has(str)
}
var standardQuotaResources = sets.NewString(
string(ResourceCPU),
string(ResourceMemory),