Documentation ¶
Index ¶
- Variables
- func AddOrUpdateTolerationInPod(pod *core.Pod, toleration *core.Toleration) bool
- func AddToNodeAddresses(addresses *[]core.NodeAddress, addAddresses ...core.NodeAddress)
- func GetAccessModesAsString(modes []core.PersistentVolumeAccessMode) string
- func GetAccessModesFromString(modes string) []core.PersistentVolumeAccessMode
- func GetPersistentVolumeClaimClass(claim *core.PersistentVolumeClaim) string
- func GetPersistentVolumeClass(volume *core.PersistentVolume) string
- func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*core.NodeAffinity, error)
- func GetTaintsFromNodeAnnotations(annotations map[string]string) ([]core.Taint, error)
- func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]core.Toleration, error)
- func HugePageResourceName(pageSize resource.Quantity) core.ResourceName
- func HugePageSizeFromResourceName(name core.ResourceName) (resource.Quantity, error)
- func IsDefaultNamespaceResource(name core.ResourceName) bool
- func IsExtendedResourceName(name core.ResourceName) bool
- func IsHugePageResourceName(name core.ResourceName) bool
- func IsIntegerResourceName(str string) bool
- func IsOvercommitAllowed(name core.ResourceName) bool
- func IsQuotaHugePageResourceName(name core.ResourceName) bool
- func IsResourceQuotaScopeValidForResource(scope core.ResourceQuotaScope, resource string) bool
- func IsServiceIPSet(service *core.Service) bool
- func IsStandardContainerResourceName(str string) bool
- func IsStandardFinalizerName(str string) bool
- func IsStandardLimitRangeType(str string) bool
- func IsStandardQuotaResourceName(str string) bool
- func IsStandardResourceName(str string) bool
- func IsStandardResourceQuotaScope(str string) bool
- func LoadBalancerStatusDeepCopy(lb *core.LoadBalancerStatus) *core.LoadBalancerStatus
- func LoadBalancerStatusEqual(l, r *core.LoadBalancerStatus) bool
- func NodeSelectorRequirementsAsSelector(nsm []core.NodeSelectorRequirement) (labels.Selector, error)
- func NonConvertibleFields(annotations map[string]string) map[string]string
- func PersistentVolumeClaimHasClass(claim *core.PersistentVolumeClaim) bool
- func PodAnnotationsFromSysctls(sysctls []core.Sysctl) string
- func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *core.NodeAffinity) error
- func SysctlsFromPodAnnotation(annotation string) ([]core.Sysctl, error)
- func SysctlsFromPodAnnotations(a map[string]string) ([]core.Sysctl, []core.Sysctl, error)
Constants ¶
This section is empty.
Variables ¶
var Semantic = conversion.EqualitiesOrDie( func(a, b resource.Quantity) bool { return a.Cmp(b) == 0 }, func(a, b metav1.MicroTime) bool { return a.UTC() == b.UTC() }, func(a, b metav1.Time) bool { return a.UTC() == b.UTC() }, func(a, b labels.Selector) bool { return a.String() == b.String() }, func(a, b fields.Selector) bool { return a.String() == b.String() }, )
Semantic can do semantic deep equality checks for core objects. Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true
Functions ¶
func AddOrUpdateTolerationInPod ¶
func AddOrUpdateTolerationInPod(pod *core.Pod, toleration *core.Toleration) bool
AddOrUpdateTolerationInPod tries to add a toleration to the pod's toleration list. Returns true if something was updated, false otherwise.
func AddToNodeAddresses ¶
func AddToNodeAddresses(addresses *[]core.NodeAddress, addAddresses ...core.NodeAddress)
AddToNodeAddresses appends the NodeAddresses to the passed-by-pointer slice, only if they do not already exist
func GetAccessModesAsString ¶
func GetAccessModesAsString(modes []core.PersistentVolumeAccessMode) string
GetAccessModesAsString returns a string representation of an array of access modes. modes, when present, are always in the same order: RWO,ROX,RWX.
func GetAccessModesFromString ¶
func GetAccessModesFromString(modes string) []core.PersistentVolumeAccessMode
GetAccessModesAsString returns an array of AccessModes from a string created by GetAccessModesAsString
func GetPersistentVolumeClaimClass ¶
func GetPersistentVolumeClaimClass(claim *core.PersistentVolumeClaim) string
GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".
func GetPersistentVolumeClass ¶
func GetPersistentVolumeClass(volume *core.PersistentVolume) string
GetPersistentVolumeClass returns StorageClassName.
func GetStorageNodeAffinityFromAnnotation ¶
func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*core.NodeAffinity, error)
GetStorageNodeAffinityFromAnnotation gets the json serialized data from PersistentVolume.Annotations and converts it to the NodeAffinity type in core. TODO: update when storage node affinity graduates to beta
func GetTaintsFromNodeAnnotations ¶
GetTaintsFromNodeAnnotations gets the json serialized taints data from Pod.Annotations and converts it to the []Taint type in core.
func GetTolerationsFromPodAnnotations ¶
func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]core.Toleration, error)
GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations and converts it to the []Toleration type in core.
func HugePageResourceName ¶
func HugePageResourceName(pageSize resource.Quantity) core.ResourceName
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 HugePageSizeFromResourceName ¶
func HugePageSizeFromResourceName(name core.ResourceName) (resource.Quantity, error)
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 IsDefaultNamespaceResource ¶
func IsDefaultNamespaceResource(name core.ResourceName) bool
IsDefaultNamespaceResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.
func IsExtendedResourceName ¶
func IsExtendedResourceName(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 IsHugePageResourceName ¶
func IsHugePageResourceName(name core.ResourceName) bool
IsHugePageResourceName returns true if the resource name has the huge page resource prefix.
func IsIntegerResourceName ¶
IsIntegerResourceName returns true if the resource is measured in integer values
func IsOvercommitAllowed ¶
func IsOvercommitAllowed(name core.ResourceName) bool
IsOvercommitAllowed returns true if the resource is in the default namespace and not blacklisted.
func IsQuotaHugePageResourceName ¶
func IsQuotaHugePageResourceName(name core.ResourceName) bool
IsQuotaHugePageResourceName returns true if the resource name has the quota related huge page resource prefix.
func IsResourceQuotaScopeValidForResource ¶
func IsResourceQuotaScopeValidForResource(scope core.ResourceQuotaScope, resource string) bool
IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope
func IsServiceIPSet ¶
this function aims to check if the service's ClusterIP is set or not the objective is not to perform validation here
func IsStandardContainerResourceName ¶
IsStandardContainerResourceName returns true if the container can make a resource request for the specified resource
func IsStandardFinalizerName ¶
func IsStandardLimitRangeType ¶
IsStandardLimitRangeType returns true if the type is Pod or Container
func IsStandardQuotaResourceName ¶
IsStandardQuotaResourceName returns true if the resource is known to the quota tracking system
func IsStandardResourceName ¶
IsStandardResourceName returns true if the resource is known to the system
func IsStandardResourceQuotaScope ¶
IsStandardResourceQuotaScope returns true if the scope is a standard value
func LoadBalancerStatusDeepCopy ¶
func LoadBalancerStatusDeepCopy(lb *core.LoadBalancerStatus) *core.LoadBalancerStatus
TODO: make method on LoadBalancerStatus?
func LoadBalancerStatusEqual ¶
func LoadBalancerStatusEqual(l, r *core.LoadBalancerStatus) bool
TODO: make method on LoadBalancerStatus?
func NodeSelectorRequirementsAsSelector ¶
func NodeSelectorRequirementsAsSelector(nsm []core.NodeSelectorRequirement) (labels.Selector, error)
NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement core type into a struct that implements labels.Selector.
func NonConvertibleFields ¶
NonConvertibleFields iterates over the provided map and filters out all but any keys with the "non-convertible.kubernetes.io" prefix.
func PersistentVolumeClaimHasClass ¶
func PersistentVolumeClaimHasClass(claim *core.PersistentVolumeClaim) bool
PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.
func PodAnnotationsFromSysctls ¶
PodAnnotationsFromSysctls creates an annotation value for a slice of Sysctls.
func StorageNodeAffinityToAlphaAnnotation ¶
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *core.NodeAffinity) error
Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes TODO: update when storage node affinity graduates to beta
func SysctlsFromPodAnnotation ¶
SysctlsFromPodAnnotation parses an annotation value into a slice of Sysctls.
func SysctlsFromPodAnnotations ¶
SysctlsFromPodAnnotations parses the sysctl annotations into a slice of safe Sysctls and a slice of unsafe Sysctls. This is only a convenience wrapper around SysctlsFromPodAnnotation.
Types ¶
This section is empty.