util

package
v0.0.0-...-f264b1e Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigErrorMessage = "Failed to create the config"

Variables

This section is empty.

Functions

func CheckCRDExist

func CheckCRDExist(crdClient crdClientSet.Interface, crdName string) (bool, error)

func CompareObject

func CompareObject(re1 runtime.RawExtension, re2 runtime.RawExtension) bool

CompareObject is used to compare two k8s objs are same or not

func GeneratePassword

func GeneratePassword(n int) (string, error)

GeneratePassword returns a base64 encoded securely random bytes.

func GetAnnotation

func GetAnnotation(annotations map[string]string, key string) string

GetAnnotation returns the annotation value for a given key, or an empty string if not set

func GetK8sObj

func GetK8sObj(kind string) runtime.Object

func GetK8sObjWithVersion

func GetK8sObjWithVersion(kind, version string) runtime.Object

GetK8sObj is used to get k8s struct based on the passed-in Kind name

func GetObject

func GetObject(re runtime.RawExtension) (runtime.Object, error)

func GetOrCreateCRDClient

func GetOrCreateCRDClient() (crdClientSet.Interface, error)

GetOrCreateCRDClient gets an existing or creates a new CRD client.

func GetOrCreateKubeClient

func GetOrCreateKubeClient() (kubernetes.Interface, error)

GetOrCreateKubeClient gets existing kubeclient or creates new one if it doesn't exist.

func GetOrCreateOCPClient

func GetOrCreateOCPClient() (ocpClientSet.Interface, error)

GetOrCreateOCPClient creates ocp client.

func GetOrCreatePromClient

func GetOrCreatePromClient() (promClientSet.Interface, error)

GetOrCreatePromClient creates prometheus client.

func GetPVCList

func GetPVCList(c client.Client, namespace string,
	matchLabels map[string]string) ([]corev1.PersistentVolumeClaim, error)

GetPVCList get pvc with matched labels.

func GetStatefulSetList

func GetStatefulSetList(c client.Client, namespace string,
	matchLabels map[string]string) ([]appsv1.StatefulSet, error)

GetStatefulSetList get sts with matched labels.

func MergeAllowlist

func MergeAllowlist(allowlist, customAllowlist, ocp3Allowlist, uwlAllowlist,
	customUwlAllowlist *operatorconfig.MetricsAllowlist) (*operatorconfig.MetricsAllowlist,
	*operatorconfig.MetricsAllowlist, *operatorconfig.MetricsAllowlist)

func ProxyEnvVarsAreSet

func ProxyEnvVarsAreSet() bool

ProxyEnvVarsAreSet ... OLM handles these environment variables as a unit; if at least one of them is set, all three are considered overridden and the cluster-wide defaults are not used for the deployments of the subscribed Operator. https://docs.openshift.com/container-platform/4.6/operators/admin/olm-configuring-proxy-support.html

func RegisterDebugEndpoint

func RegisterDebugEndpoint(register func(string, http.Handler) error) error

func Remove

func Remove(list []string, s string) []string

Remove is used to remove string from a string array

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

func UpdateCRDWebhookNS

func UpdateCRDWebhookNS(crdClient crdClientSet.Interface, namespace, crdName string) error

func UpdateDeployLabel

func UpdateDeployLabel(c client.Client, dName, namespace, label string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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