utils

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHashAnnotation added in v1.5.0

func AddHashAnnotation(r Annotated)

func AppendValuesToStringArrayIfNotPresent added in v1.3.0

func AppendValuesToStringArrayIfNotPresent(a []string, values ...string) []string

func ElementsMatch added in v1.5.0

func ElementsMatch(a interface{}, b interface{}) bool

func FilterNodesWithFn added in v1.5.0

func FilterNodesWithFn(nodes []*corev1.Node, fn func(*corev1.Node) bool) []*corev1.Node

func FilterNodesWithTaintKeyValueEffect added in v1.5.0

func FilterNodesWithTaintKeyValueEffect(nodes []*corev1.Node, taintKey, value string, effect corev1.TaintEffect) []*corev1.Node

func FilterPVCsWithFn added in v1.5.0

k8s PVC helpers

func FilterPodsWithAnnotationKey added in v1.5.0

func FilterPodsWithAnnotationKey(pods []*corev1.Pod, key string) []*corev1.Pod

func FilterPodsWithFn added in v1.5.0

func FilterPodsWithFn(pods []*corev1.Pod, fn func(*corev1.Pod) bool) []*corev1.Pod

func FilterPodsWithLabel added in v1.5.0

func FilterPodsWithLabel(pods []*corev1.Pod, label, value string) []*corev1.Pod

func FilterPodsWithNodeInNameSet added in v1.5.0

func FilterPodsWithNodeInNameSet(pods []*corev1.Pod, nameSet StringSet) []*corev1.Pod

func GenerateJKS added in v1.4.0

func GenerateJKS(ca *corev1.Secret, podname, dcname string) (jksblob []byte, err error)

func GetNewCAandKey added in v1.4.0

func GetNewCAandKey(leafdomain, namespace string) (keypem, certpem string, err error)

func GetPVCSelectedNodeName added in v1.5.0

func GetPVCSelectedNodeName(pvc *corev1.PersistentVolumeClaim) string

func IndexOfString added in v1.3.0

func IndexOfString(a []string, v string) int

func IsPSPEnabled added in v1.5.0

func IsPSPEnabled() bool

func IsPodUnschedulable added in v1.5.0

func IsPodUnschedulable(pod *corev1.Pod) bool

k8s Pod helper functions

func MergeMap

func MergeMap(destination map[string]string, sources ...map[string]string) map[string]string

MergeMap will take two maps, merging the entries of the source map into destination map. If both maps share the same key then destination's value for that key will be overwritten with what's in source.

func RangeInt added in v1.5.0

func RangeInt(min, max, step int) []int

func RemoveValueFromStringArray added in v1.3.0

func RemoveValueFromStringArray(a []string, v string) []string

func ResourcesHaveSameHash added in v1.5.0

func ResourcesHaveSameHash(r1, r2 Annotated) bool

func SearchMap

func SearchMap(mapToSearch map[string]interface{}, key string) map[string]interface{}

SearchMap will recursively search a map looking for a key with a value of another map

Types

type Annotated added in v1.5.0

type Annotated interface {
	GetAnnotations() map[string]string
	SetAnnotations(annotations map[string]string)
}

type StringSet added in v1.5.0

type StringSet map[string]bool

StringSet helper functions

func GetNodeNameSet added in v1.5.0

func GetNodeNameSet(nodes []*corev1.Node) StringSet

k8s Node helper functions

func GetPodNameSet added in v1.5.0

func GetPodNameSet(pods []*corev1.Pod) StringSet

func GetPodNodeNameSet added in v1.5.0

func GetPodNodeNameSet(pods []*corev1.Pod) StringSet

func IntersectionStringSet added in v1.5.1

func IntersectionStringSet(a, b StringSet) StringSet

func SubtractStringSet added in v1.5.0

func SubtractStringSet(a, b StringSet) StringSet

func UnionStringSet added in v1.5.0

func UnionStringSet(a, b StringSet) StringSet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL