Documentation ¶
Index ¶
- Variables
- func AddOrUpdateTolerationInPod(pod *api.Pod, toleration *api.Toleration) bool
- func AddToNodeAddresses(addresses *[]api.NodeAddress, addAddresses ...api.NodeAddress)
- func GetAccessModesAsString(modes []api.PersistentVolumeAccessMode) string
- func GetAccessModesFromString(modes string) []api.PersistentVolumeAccessMode
- func GetAffinityFromPodAnnotations(annotations map[string]string) (*api.Affinity, error)
- func GetPersistentVolumeClaimClass(claim *api.PersistentVolumeClaim) string
- func GetPersistentVolumeClass(volume *api.PersistentVolume) string
- func GetTaintsFromNodeAnnotations(annotations map[string]string) ([]api.Taint, error)
- func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]api.Toleration, error)
- func HasAnnotation(obj api.ObjectMeta, ann string) bool
- func HashObject(obj runtime.Object, codec runtime.Codec) (string, error)
- func IsIntegerResourceName(str string) bool
- func IsOpaqueIntResourceName(name api.ResourceName) bool
- func IsResourceQuotaScopeValidForResource(scope api.ResourceQuotaScope, resource string) bool
- func IsServiceIPRequested(service *api.Service) bool
- func IsServiceIPSet(service *api.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 *api.LoadBalancerStatus) *api.LoadBalancerStatus
- func LoadBalancerStatusEqual(l, r *api.LoadBalancerStatus) bool
- func NodeSelectorRequirementsAsSelector(nsm []api.NodeSelectorRequirement) (labels.Selector, error)
- func NonConvertibleFields(annotations map[string]string) map[string]string
- func OpaqueIntResourceName(name string) api.ResourceName
- func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error)
- func PersistentVolumeClaimHasClass(claim *api.PersistentVolumeClaim) bool
- func PodAnnotationsFromSysctls(sysctls []api.Sysctl) string
- func SetMetaDataAnnotation(obj *api.ObjectMeta, ann string, value string)
- func SysctlsFromPodAnnotation(annotation string) ([]api.Sysctl, error)
- func SysctlsFromPodAnnotations(a map[string]string) ([]api.Sysctl, []api.Sysctl, error)
- func TaintToleratedByTolerations(taint *api.Taint, tolerations []api.Toleration) bool
- func TolerationToleratesTaint(toleration *api.Toleration, taint *api.Taint) bool
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.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 api objects. Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true
Functions ¶
func AddOrUpdateTolerationInPod ¶
func AddOrUpdateTolerationInPod(pod *api.Pod, toleration *api.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 *[]api.NodeAddress, addAddresses ...api.NodeAddress)
AddToNodeAddresses appends the NodeAddresses to the passed-by-pointer slice, only if they do not already exist
func GetAccessModesAsString ¶
func GetAccessModesAsString(modes []api.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) []api.PersistentVolumeAccessMode
GetAccessModesAsString returns an array of AccessModes from a string created by GetAccessModesAsString
func GetAffinityFromPodAnnotations ¶
GetAffinityFromPodAnnotations gets the json serialized affinity data from Pod.Annotations and converts it to the Affinity type in api. TODO: remove when alpha support for affinity is removed
func GetPersistentVolumeClaimClass ¶
func GetPersistentVolumeClaimClass(claim *api.PersistentVolumeClaim) string
GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".
func GetPersistentVolumeClass ¶
func GetPersistentVolumeClass(volume *api.PersistentVolume) string
GetPersistentVolumeClass returns StorageClassName.
func GetTaintsFromNodeAnnotations ¶
GetTaintsFromNodeAnnotations gets the json serialized taints data from Pod.Annotations and converts it to the []Taint type in api.
func GetTolerationsFromPodAnnotations ¶
func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]api.Toleration, error)
GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations and converts it to the []Toleration type in api.
func HasAnnotation ¶
func HasAnnotation(obj api.ObjectMeta, ann string) bool
HasAnnotation returns a bool if passed in annotation exists
func IsIntegerResourceName ¶
IsIntegerResourceName returns true if the resource is measured in integer values
func IsOpaqueIntResourceName ¶
func IsOpaqueIntResourceName(name api.ResourceName) bool
IsOpaqueIntResourceName returns true if the resource name has the opaque integer resource prefix.
func IsResourceQuotaScopeValidForResource ¶
func IsResourceQuotaScopeValidForResource(scope api.ResourceQuotaScope, resource string) bool
IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope
func IsServiceIPRequested ¶
this function aims to check if the service's cluster IP is requested or not
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 *api.LoadBalancerStatus) *api.LoadBalancerStatus
TODO: make method on LoadBalancerStatus?
func LoadBalancerStatusEqual ¶
func LoadBalancerStatusEqual(l, r *api.LoadBalancerStatus) bool
TODO: make method on LoadBalancerStatus?
func NodeSelectorRequirementsAsSelector ¶
func NodeSelectorRequirementsAsSelector(nsm []api.NodeSelectorRequirement) (labels.Selector, error)
NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api 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 OpaqueIntResourceName ¶
func OpaqueIntResourceName(name string) api.ResourceName
OpaqueIntResourceName returns a ResourceName with the canonical opaque integer prefix prepended. If the argument already has the prefix, it is returned unmodified.
func ParseRFC3339 ¶
ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
func PersistentVolumeClaimHasClass ¶
func PersistentVolumeClaimHasClass(claim *api.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 SetMetaDataAnnotation ¶
func SetMetaDataAnnotation(obj *api.ObjectMeta, ann string, value string)
SetMetaDataAnnotation sets the annotation and value
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.
func TaintToleratedByTolerations ¶
func TaintToleratedByTolerations(taint *api.Taint, tolerations []api.Toleration) bool
TaintToleratedByTolerations checks if taint is tolerated by any of the tolerations.
func TolerationToleratesTaint ¶
func TolerationToleratesTaint(toleration *api.Toleration, taint *api.Taint) bool
TolerationToleratesTaint checks if the toleration tolerates the taint.
Types ¶
This section is empty.