Documentation ¶
Index ¶
- func AddOrUpdateTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error)
- func AddOrUpdateTolerationInPod(pod *v1.Pod, toleration *v1.Toleration) bool
- func AddToNodeAddresses(addresses *[]v1.NodeAddress, addAddresses ...v1.NodeAddress)
- func DeleteTaint(taints []v1.Taint, taintToDelete *v1.Taint) ([]v1.Taint, bool)
- func DeleteTaintsByKey(taints []v1.Taint, taintKey string) ([]v1.Taint, bool)
- func GetAccessModesAsString(modes []v1.PersistentVolumeAccessMode) string
- func GetAccessModesFromString(modes string) []v1.PersistentVolumeAccessMode
- func GetAffinityFromPodAnnotations(annotations map[string]string) (*v1.Affinity, error)
- func GetAvoidPodsFromNodeAnnotations(annotations map[string]string) (v1.AvoidPods, error)
- func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (bool, []v1.Toleration)
- func GetPersistentVolumeClaimClass(claim *v1.PersistentVolumeClaim) string
- func GetPersistentVolumeClass(volume *v1.PersistentVolume) string
- func IsOpaqueIntResourceName(name v1.ResourceName) bool
- func IsServiceIPRequested(service *v1.Service) bool
- func IsServiceIPSet(service *v1.Service) bool
- func LoadBalancerStatusDeepCopy(lb *v1.LoadBalancerStatus) *v1.LoadBalancerStatus
- func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool
- func NodeSelectorRequirementsAsSelector(nsm []v1.NodeSelectorRequirement) (labels.Selector, error)
- func OpaqueIntResourceName(name string) v1.ResourceName
- func PersistentVolumeClaimHasClass(claim *v1.PersistentVolumeClaim) bool
- func PodAnnotationsFromSysctls(sysctls []v1.Sysctl) string
- func RemoveTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error)
- func SysctlsFromPodAnnotation(annotation string) ([]v1.Sysctl, error)
- func SysctlsFromPodAnnotations(a map[string]string) ([]v1.Sysctl, []v1.Sysctl, error)
- func TaintExists(taints []v1.Taint, taintToFind *v1.Taint) bool
- func TolerationsTolerateTaint(tolerations []v1.Toleration, taint *v1.Taint) bool
- func TolerationsTolerateTaintsWithFilter(tolerations []v1.Toleration, taints []v1.Taint, applyFilter taintsFilterFunc) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateTaint ¶
Tries to add a taint to annotations list. Returns a new copy of updated Node and true if something was updated false otherwise.
func AddOrUpdateTolerationInPod ¶
func AddOrUpdateTolerationInPod(pod *v1.Pod, toleration *v1.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 *[]v1.NodeAddress, addAddresses ...v1.NodeAddress)
AddToNodeAddresses appends the NodeAddresses to the passed-by-pointer slice, only if they do not already exist
func DeleteTaint ¶
DeleteTaint removes all the the taints that have the same key and effect to given taintToDelete.
func DeleteTaintsByKey ¶
DeleteTaintsByKey removes all the taints that have the same key to given taintKey
func GetAccessModesAsString ¶
func GetAccessModesAsString(modes []v1.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) []v1.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 GetMatchingTolerations ¶
func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (bool, []v1.Toleration)
Returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
func GetPersistentVolumeClaimClass ¶
func GetPersistentVolumeClaimClass(claim *v1.PersistentVolumeClaim) string
GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".
func GetPersistentVolumeClass ¶
func GetPersistentVolumeClass(volume *v1.PersistentVolume) string
GetPersistentVolumeClass returns StorageClassName.
func IsOpaqueIntResourceName ¶
func IsOpaqueIntResourceName(name v1.ResourceName) bool
IsOpaqueIntResourceName returns true if the resource name has the opaque integer resource prefix.
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 LoadBalancerStatusDeepCopy ¶
func LoadBalancerStatusDeepCopy(lb *v1.LoadBalancerStatus) *v1.LoadBalancerStatus
TODO: make method on LoadBalancerStatus?
func LoadBalancerStatusEqual ¶
func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool
TODO: make method on LoadBalancerStatus?
func NodeSelectorRequirementsAsSelector ¶
func NodeSelectorRequirementsAsSelector(nsm []v1.NodeSelectorRequirement) (labels.Selector, error)
NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements labels.Selector.
func OpaqueIntResourceName ¶
func OpaqueIntResourceName(name string) v1.ResourceName
OpaqueIntResourceName returns a ResourceName with the canonical opaque integer prefix prepended. If the argument already has the prefix, it is returned unmodified.
func PersistentVolumeClaimHasClass ¶
func PersistentVolumeClaimHasClass(claim *v1.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 RemoveTaint ¶
Tries to remove a taint from annotations list. Returns a new copy of updated Node and true if something was updated false otherwise.
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 TolerationsTolerateTaint ¶
func TolerationsTolerateTaint(tolerations []v1.Toleration, taint *v1.Taint) bool
TolerationsTolerateTaint checks if taint is tolerated by any of the tolerations.
func TolerationsTolerateTaintsWithFilter ¶
func TolerationsTolerateTaintsWithFilter(tolerations []v1.Toleration, taints []v1.Taint, applyFilter taintsFilterFunc) bool
TolerationsTolerateTaintsWithFilter checks if given tolerations tolerates all the taints that apply to the filter in given taint list.
Types ¶
This section is empty.