Documentation ¶
Index ¶
- Constants
- Variables
- func AddHashAnnotation(r Annotated)
- func AppendValuesToStringArrayIfNotPresent(a []string, values ...string) []string
- func ElementsMatch(a interface{}, b interface{}) bool
- func FilterNodesWithFn(nodes []*corev1.Node, fn func(*corev1.Node) bool) []*corev1.Node
- func FilterNodesWithTaintKeyValueEffect(nodes []*corev1.Node, taintKey, value string, effect corev1.TaintEffect) []*corev1.Node
- func FilterPVCsWithFn(pvcs []*corev1.PersistentVolumeClaim, ...) []*corev1.PersistentVolumeClaim
- func FilterPodsWithAnnotationKey(pods []*corev1.Pod, key string) []*corev1.Pod
- func FilterPodsWithFn(pods []*corev1.Pod, fn func(*corev1.Pod) bool) []*corev1.Pod
- func FilterPodsWithLabel(pods []*corev1.Pod, label, value string) []*corev1.Pod
- func FilterPodsWithNodeInNameSet(pods []*corev1.Pod, nameSet StringSet) []*corev1.Pod
- func GenerateJKS(ca *corev1.Secret, podname, dcname string) (jksblob []byte, err error)
- func GetGVKsFromAddToScheme(addToSchemeFunc func(*runtime.Scheme) error) ([]schema.GroupVersionKind, error)
- func GetNewCAandKey(leafdomain, namespace string) (keypem, certpem string, err error)
- func GetOperatorNamespace() (string, error)
- func GetPVCSelectedNodeName(pvc *corev1.PersistentVolumeClaim) string
- func GetWatchNamespace() (string, error)
- func IndexOfString(a []string, v string) int
- func IsPSPEnabled() bool
- func IsPodUnschedulable(pod *corev1.Pod) bool
- func MergeMap(destination map[string]string, sources ...map[string]string) map[string]string
- func RangeInt(min, max, step int) []int
- func RemoveValueFromStringArray(a []string, v string) []string
- func ResourcesHaveSameHash(r1, r2 Annotated) bool
- func SearchMap(mapToSearch map[string]interface{}, key string) map[string]interface{}
- type Annotated
- type RunModeType
- type StringSet
- func GetNodeNameSet(nodes []*corev1.Node) StringSet
- func GetPodNameSet(pods []*corev1.Pod) StringSet
- func GetPodNodeNameSet(pods []*corev1.Pod) StringSet
- func IntersectionStringSet(a, b StringSet) StringSet
- func SubtractStringSet(a, b StringSet) StringSet
- func UnionStringSet(a, b StringSet) StringSet
Constants ¶
const ( // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which is the namespace where the watch activity happens. // this value is empty if the operator is running with clusterScope. WatchNamespaceEnvVar = "WATCH_NAMESPACE" )
Variables ¶
var ErrNoNamespace = fmt.Errorf("namespace not found for current environment")
ErrNoNamespace indicates that a namespace could not be found for the current environment
var ErrRunLocal = fmt.Errorf("operator run mode forced to local")
ErrRunLocal indicates that the operator is set to run in local mode (this error is returned by functions that only work on operators running in cluster mode)
var ForceRunModeEnv = "OSDK_FORCE_RUN_MODE"
ForceRunModeEnv indicates if the operator should be forced to run in either local or cluster mode (currently only used for local mode)
Functions ¶
func AddHashAnnotation ¶
func AddHashAnnotation(r Annotated)
func ElementsMatch ¶
func ElementsMatch(a interface{}, b interface{}) bool
func FilterNodesWithFn ¶
func FilterPVCsWithFn ¶
func FilterPVCsWithFn(pvcs []*corev1.PersistentVolumeClaim, fn func(*corev1.PersistentVolumeClaim) bool) []*corev1.PersistentVolumeClaim
k8s PVC helpers
func FilterPodsWithFn ¶
func FilterPodsWithLabel ¶
func GenerateJKS ¶
func GetGVKsFromAddToScheme ¶
func GetGVKsFromAddToScheme(addToSchemeFunc func(*runtime.Scheme) error) ([]schema.GroupVersionKind, error)
GetGVKsFromAddToScheme takes in the runtime scheme and filters out all generic apimachinery meta types. It returns just the GVK specific to this scheme.
func GetNewCAandKey ¶
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the operator should be running in.
func GetPVCSelectedNodeName ¶
func GetPVCSelectedNodeName(pvc *corev1.PersistentVolumeClaim) string
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func IndexOfString ¶
func IsPSPEnabled ¶
func IsPSPEnabled() bool
func MergeMap ¶
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 ResourcesHaveSameHash ¶
Types ¶
type RunModeType ¶
type RunModeType string
const ( LocalRunMode RunModeType = "local" ClusterRunMode RunModeType = "cluster" )
type StringSet ¶
StringSet helper functions