Resource Quota should not let fractional values for API resources
This commit is contained in:
@@ -80,20 +80,36 @@ var Semantic = conversion.EqualitiesOrDie(
|
||||
)
|
||||
|
||||
var standardResources = sets.NewString(
|
||||
string(ResourceMemory),
|
||||
string(ResourceCPU),
|
||||
string(ResourceMemory),
|
||||
string(ResourcePods),
|
||||
string(ResourceQuotas),
|
||||
string(ResourceServices),
|
||||
string(ResourceReplicationControllers),
|
||||
string(ResourceSecrets),
|
||||
string(ResourcePersistentVolumeClaims),
|
||||
string(ResourceStorage))
|
||||
string(ResourceStorage),
|
||||
)
|
||||
|
||||
// IsStandardResourceName returns true if the resource is known to the system
|
||||
func IsStandardResourceName(str string) bool {
|
||||
return standardResources.Has(str)
|
||||
}
|
||||
|
||||
var integerResources = sets.NewString(
|
||||
string(ResourcePods),
|
||||
string(ResourceQuotas),
|
||||
string(ResourceServices),
|
||||
string(ResourceReplicationControllers),
|
||||
string(ResourceSecrets),
|
||||
string(ResourcePersistentVolumeClaims),
|
||||
)
|
||||
|
||||
// IsIntegerResourceName returns true if the resource is measured in integer values
|
||||
func IsIntegerResourceName(str string) bool {
|
||||
return integerResources.Has(str)
|
||||
}
|
||||
|
||||
// NewDeleteOptions returns a DeleteOptions indicating the resource should
|
||||
// be deleted within the specified grace period. Use zero to indicate
|
||||
// immediate deletion. If you would prefer to use the default grace period,
|
||||
|
Reference in New Issue
Block a user