resources

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRetry = wait.Backoff{
	Steps:    150,
	Duration: 4 * time.Second,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is the default backoff for e2e tests.

Functions

func CreateContainerElement

func CreateContainerElement(containerName csiv1.ImageType, image string, imagePullPolicy corev1.PullPolicy, args []string, envs []corev1.EnvVar,
	volumeMounts []corev1.VolumeMount, securityContext *corev1.SecurityContext, command []string) corev1.Container

CreateContainerElement - Creates a generic container element for the given component of the given object

func CreateCustomResource

func CreateCustomResource(jsonData string, name, namespace string, resourceName string) (err error)

CreateCustomResource - Creates Snapshot custom resource

func CreateNamespace

func CreateNamespace(name string, client client.Client, reqLogger logr.Logger) (reconcile.Result, error)

CreateNamespace - Creates a namespace

func GetDummyOwnerReferences

func GetDummyOwnerReferences(clusterRole *rbacv1.ClusterRole) []metav1.OwnerReference

GetDummyOwnerReferences - returns owner references

func GetKubeAPIServerVersion

func GetKubeAPIServerVersion() (*version.Info, error)

GetKubeAPIServerVersion - Returns the Kubernetes API server version

func GetOwnerReferences

func GetOwnerReferences(driver csiv1.CSIDriver) []metav1.OwnerReference

GetOwnerReferences - Returns OwnerReferences for a specific driver

func GetRestClient

func GetRestClient(schemaObj *schema.GroupVersion) (*rest.RESTClient, error)

GetRestClient - Returns a rest client to be used with k8s APIs

func IsOpenshift

func IsOpenshift() (bool, error)

IsOpenshift - Returns a boolean which indicates if we are running in an OpenShift cluster

func IsStringInSlice

func IsStringInSlice(str string, slice []string) bool

IsStringInSlice - Checks if a given string is present in a slice

func JSONPrettyPrint

func JSONPrettyPrint(obj interface{}) string

JSONPrettyPrint - Indent the json output

func NewNamespace

func NewNamespace(namespace string) *corev1.Namespace

NewNamespace - Returns a pointer to namespace resource

func Retry

func Retry(backoff wait.Backoff, fn wait.ConditionFunc) error

Retry executes the provided function repeatedly, retrying until the function returns done = true, errors, or exceeds the given timeout.

func WaitForCustomResourceToDelete

func WaitForCustomResourceToDelete(namespace string, resourceName string, restClient rest.RESTClient) (err error)

WaitForCustomResourceToDelete - wait for the CR to be deleted

Types

This section is empty.

Jump to

Keyboard shortcuts

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