Documentation ¶
Index ¶
- Constants
- func AddStringToSliceIfMissing(slice []string, toAdd string) []string
- func CreateAndStartRecorder(kubeclientset kubernetes.Interface, name string) record.EventRecorder
- func GetNodeAPIVersion(node *corev1.Node, pods []*corev1.Pod) string
- func GetNodeKubeControllerManagerVersion(node *corev1.Node, pods []*corev1.Pod) string
- func GetNodeSchedulerVersion(node *corev1.Node, pods []*corev1.Pod) string
- func IndexByIDKeyFun() cache.Indexers
- func MetaResourceNamespaceKeyFunc(kind string, obj interface{}) (string, error)
- func NodeIsReady(node *corev1.Node) bool
- func NodeIsTargetKubernetesVersion(cup *provisioncsv3.ClusterUpgrade, node *corev1.Node, pods []*corev1.Pod) bool
- func RemoveStringFromSlice(slice []string, toRemove string) []string
- func SplitMetaResourceNamespaceKeyFunc(key string) (kind, namespace, name string, err error)
- func StringMapsAreEqual(a, b map[string]string) bool
- func StringSliceContains(slice []string, checkFor string) bool
- func StringSlicesAreEqual(a, b []string) bool
Constants ¶
const ( // IndexByIDFunctionName is the name of the index function we define to // access items by ID. IndexByIDFunctionName = "byID" )
Variables ¶
This section is empty.
Functions ¶
func AddStringToSliceIfMissing ¶
AddStringToSliceIfMissing returns a copy of the passed string slice with the toAdd string added if it did not exist. If toAdd already exists in the passed slice, the original slice is returned. The new string will be appended to the end of the slice and the order of the original elements will match the order of the original slice. If a nil slice is passed, a new slice will be created containing only toAdd.
func CreateAndStartRecorder ¶
func CreateAndStartRecorder(kubeclientset kubernetes.Interface, name string) record.EventRecorder
CreateAndStartRecorder creates and starts a new recorder with the given name
func GetNodeAPIVersion ¶
GetNodeAPIVersion returns the version of the static pod running the api server
func GetNodeKubeControllerManagerVersion ¶
GetNodeKubeControllerManagerVersion returns the version of the static pod running the kube controller manager
func GetNodeSchedulerVersion ¶
GetNodeSchedulerVersion returns the version of the static pod running the scheduler
func IndexByIDKeyFun ¶
IndexByIDKeyFun returns a function for indexing a cache by ID
func MetaResourceNamespaceKeyFunc ¶
MetaResourceNamespaceKeyFunc is a convenient KeyFunc which knows how to make keys for API objects which implement meta.Interface. The key uses the format <kind>/<namespace>/<name> unless <namespace> is empty, then it's <kind>/<name>.
func NodeIsReady ¶
NodeIsReady returns true if the given node has a Ready status, else false. See https://kubernetes.io/docs/concepts/nodes/node/#condition for more info.
func NodeIsTargetKubernetesVersion ¶
func NodeIsTargetKubernetesVersion(cup *provisioncsv3.ClusterUpgrade, node *corev1.Node, pods []*corev1.Pod) bool
NodeIsTargetKubernetesVersion checks if the current node version matches the target version of the cluster upgrade that is being processed. This only checks that the kubelet is up to date on worker nodes, and that on masters kubelet and static pods are at the desired version. NOTE: this should only be called with upgrades of type Kubernetes
func RemoveStringFromSlice ¶
RemoveStringFromSlice returns a copy of the passed string slice with all instances of the toRemove string removed if it exists. The order of the remaining elements will match the order of the original slice. If a nil slice is passed, nil will be returned.
func SplitMetaResourceNamespaceKeyFunc ¶
SplitMetaResourceNamespaceKeyFunc returns the kind, namespace and name that MetaResourceNamespaceKeyFunc encoded into key.
func StringMapsAreEqual ¶
StringMapsAreEqual compares two string maps, checking the first map to see if each of the keys are present and contains the same values as the second map
func StringSliceContains ¶
StringSliceContains returns true if the passed slice contains the checkFor string, else false.
func StringSlicesAreEqual ¶
StringSlicesAreEqual returns true if slice a and b are equal, else false. If a or b is nil, they are equal if both are nil. If two slices contain the same elements but in a different order, they are not equal.
Types ¶
This section is empty.