// IsHugePageResourceName returns true if the resource name has the huge page // resource prefix. func IsHugePageResourceName(name core.ResourceName) bool { … } // IsHugePageResourceValueDivisible returns true if the resource value of storage is // integer multiple of page size. func IsHugePageResourceValueDivisible(name core.ResourceName, quantity resource.Quantity) bool { … } // IsQuotaHugePageResourceName returns true if the resource name has the quota // related huge page resource prefix. func IsQuotaHugePageResourceName(name core.ResourceName) bool { … } // HugePageResourceName returns a ResourceName with the canonical hugepage // prefix prepended for the specified page size. The page size is converted // to its canonical representation. func HugePageResourceName(pageSize resource.Quantity) core.ResourceName { … } // HugePageSizeFromResourceName returns the page size for the specified huge page // resource name. If the specified input is not a valid huge page resource name // an error is returned. func HugePageSizeFromResourceName(name core.ResourceName) (resource.Quantity, error) { … } // NonConvertibleFields iterates over the provided map and filters out all but // any keys with the "non-convertible.kubernetes.io" prefix. func NonConvertibleFields(annotations map[string]string) map[string]string { … } var Semantic … var standardResourceQuotaScopes … // IsStandardResourceQuotaScope returns true if the scope is a standard value func IsStandardResourceQuotaScope(scope core.ResourceQuotaScope) bool { … } var podObjectCountQuotaResources … var podComputeQuotaResources … // IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope func IsResourceQuotaScopeValidForResource(scope core.ResourceQuotaScope, resource core.ResourceName) bool { … } var standardContainerResources … // IsStandardContainerResourceName returns true if the container can make a resource request // for the specified resource func IsStandardContainerResourceName(name core.ResourceName) bool { … } // IsExtendedResourceName returns true if: // 1. the resource name is not in the default namespace; // 2. resource name does not have "requests." prefix, // to avoid confusion with the convention in quota // 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name func IsExtendedResourceName(name core.ResourceName) bool { … } // IsNativeResource returns true if the resource name is in the // *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are // implicitly in the kubernetes.io/ namespace. func IsNativeResource(name core.ResourceName) bool { … } // IsOvercommitAllowed returns true if the resource is in the default // namespace and is not hugepages. func IsOvercommitAllowed(name core.ResourceName) bool { … } var standardLimitRangeTypes … // IsStandardLimitRangeType returns true if the type is Pod or Container func IsStandardLimitRangeType(value core.LimitType) bool { … } var standardQuotaResources … // IsStandardQuotaResourceName returns true if the resource is known to // the quota tracking system func IsStandardQuotaResourceName(name core.ResourceName) bool { … } var standardResources … // IsStandardResourceName returns true if the resource is known to the system func IsStandardResourceName(name core.ResourceName) bool { … } var integerResources … // IsIntegerResourceName returns true if the resource is measured in integer values func IsIntegerResourceName(name core.ResourceName) bool { … } // IsServiceIPSet aims to check if the service's ClusterIP is set or not // the objective is not to perform validation here func IsServiceIPSet(service *core.Service) bool { … } var standardFinalizers … // IsStandardFinalizerName checks if the input string is a standard finalizer name func IsStandardFinalizerName(str string) bool { … } // GetAccessModesAsString returns a string representation of an array of access modes. // modes, when present, are always in the same order: RWO,ROX,RWX,RWOP. func GetAccessModesAsString(modes []core.PersistentVolumeAccessMode) string { … } // GetAccessModesFromString returns an array of AccessModes from a string created by GetAccessModesAsString func GetAccessModesFromString(modes string) []core.PersistentVolumeAccessMode { … } // removeDuplicateAccessModes returns an array of access modes without any duplicates func removeDuplicateAccessModes(modes []core.PersistentVolumeAccessMode) []core.PersistentVolumeAccessMode { … } func ContainsAccessMode(modes []core.PersistentVolumeAccessMode, mode core.PersistentVolumeAccessMode) bool { … } func ClaimContainsAllocatedResources(pvc *core.PersistentVolumeClaim) bool { … } func ClaimContainsAllocatedResourceStatus(pvc *core.PersistentVolumeClaim) bool { … } // GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations // and converts it to the []Toleration type in core. func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]core.Toleration, error) { … } // AddOrUpdateTolerationInPod tries to add a toleration to the pod's toleration list. // Returns true if something was updated, false otherwise. func AddOrUpdateTolerationInPod(pod *core.Pod, toleration *core.Toleration) bool { … } // GetTaintsFromNodeAnnotations gets the json serialized taints data from Pod.Annotations // and converts it to the []Taint type in core. func GetTaintsFromNodeAnnotations(annotations map[string]string) ([]core.Taint, error) { … } // GetPersistentVolumeClass returns StorageClassName. func GetPersistentVolumeClass(volume *core.PersistentVolume) string { … } // GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was // requested, it returns "". func GetPersistentVolumeClaimClass(claim *core.PersistentVolumeClaim) string { … } // PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field. func PersistentVolumeClaimHasClass(claim *core.PersistentVolumeClaim) bool { … } // GetDeletionCostFromPodAnnotations returns the integer value of pod-deletion-cost. Returns 0 // if not set or the value is invalid. func GetDeletionCostFromPodAnnotations(annotations map[string]string) (int32, error) { … } func validFirstDigit(str string) bool { … }