util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotationToPod

func AddAnnotationToPod(ctx context.Context, c clientset.Interface, namespace, podName string, ann map[string]string) (*corev1.Pod, error)

func CleanupClusterRole

func CleanupClusterRole(ctx context.Context, c clientset.Interface, nsBaseName string) error

func CleanupClusterRoleBinding

func CleanupClusterRoleBinding(ctx context.Context, c clientset.Interface, nsBaseName string) error

func CleanupRole

func CleanupRole(ctx context.Context, c clientset.Interface, nsBaseName, ns string) error

func CleanupRoleBinding

func CleanupRoleBinding(ctx context.Context, c clientset.Interface, nsBaseName, ns string) error

func CreateConfigMap

func CreateConfigMap(c clientset.Interface, ns, name string, data map[string]string) (*v1.ConfigMap, error)

func CreateDaemonset

func CreateDaemonset(c clientset.Interface, ns string, DaemonSet *apps.DaemonSet) (*apps.DaemonSet, error)

func CreateDeployment

func CreateDeployment(c clientset.Interface, ns string, deployment *apps.Deployment) (*apps.Deployment, error)

func CreateNamespace

func CreateNamespace(ctx context.Context, c clientset.Interface, name string) error

func CreateNamespaceWithAnnotation

func CreateNamespaceWithAnnotation(ctx context.Context, c clientset.Interface, namespace string, annotation map[string]string) error

func CreateNamespaceWithLabel

func CreateNamespaceWithLabel(ctx context.Context, c clientset.Interface, namespace string, label map[string]string) error

func CreatePod

func CreatePod(c clientset.Interface, ns, name string) (*corev1.Pod, error)

func CreatePodWithEnvFromConfigmap added in v1.0.1

func CreatePodWithEnvFromConfigmap(c clientset.Interface, ns, name, configName string) (*corev1.Pod, error)

func CreatePodWithEnvFromSecret added in v1.0.1

func CreatePodWithEnvFromSecret(c clientset.Interface, ns, name, secretName string) (*corev1.Pod, error)

func CreatePodWithEnvValueConfigmap added in v1.0.1

func CreatePodWithEnvValueConfigmap(c clientset.Interface, ns, name, configName string) (*corev1.Pod, error)

func CreatePodWithEnvValueSecret added in v1.0.1

func CreatePodWithEnvValueSecret(c clientset.Interface, ns, name, secretName string) (*corev1.Pod, error)

CreatePodWithEnvValueSecret

func CreatePodWithServiceAccount

func CreatePodWithServiceAccount(c clientset.Interface, ns, name, serviceAccountName string) (*corev1.Pod, error)

func CreateRBACWithBindingSA

func CreateRBACWithBindingSA(ctx context.Context, c clientset.Interface, namespace string, serviceaccount string, clusterrole string, clusterrolebinding string) error

func CreateRBACWithBindingSAWithRole

func CreateRBACWithBindingSAWithRole(ctx context.Context, c clientset.Interface, saNamespace string, ns, serviceaccount string, role string, rolebinding string) error

func CreateSecret

func CreateSecret(c clientset.Interface, ns, name string, labels map[string]string) (*v1.Secret, error)

func CreateSecretWithData added in v1.0.1

func CreateSecretWithData(c clientset.Interface, ns, name string, labels map[string]string, data map[string][]byte) (*v1.Secret, error)

CreateSecretWithData

func CreateService

func CreateService(c clientset.Interface, ns, name string) (*corev1.Service, error)

func CreateServiceAccount

func CreateServiceAccount(ctx context.Context, c clientset.Interface, ns string, serviceaccount string) error

func CreateStatefulset

func CreateStatefulset(c clientset.Interface, ns string, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error)

func CreateStorageClass

func CreateStorageClass(c clientset.Interface, name string) (*v1.StorageClass, error)

func CreateVCCredentialSecret

func CreateVCCredentialSecret(c clientset.Interface, veleroNamespace string) error

CreateVCCredentialSecret refer to https://github.com/vmware-tanzu/velero-plugin-for-vsphere/blob/v1.3.0/docs/vanilla.md

func DeleteConfigmap

func DeleteConfigmap(c clientset.Interface, ns, name string) error

func DeleteDaemonSet

func DeleteDaemonSet(c clientset.Interface, name, ns string) error

func DeleteDeployment

func DeleteDeployment(c clientset.Interface, name, ns string) error

func DeleteNamespace

func DeleteNamespace(ctx context.Context, c clientset.Interface, namespace string, wait bool) error

func DeletePod

func DeletePod(ctx context.Context, c clientset.Interface, namespace, podName string) error

func DeleteSecret

func DeleteSecret(c clientset.Interface, ns, name string) error

func DeleteService

func DeleteService(c clientset.Interface, namespace, name string) error

func DeleteServiceAccount

func DeleteServiceAccount(ctx context.Context, c clientset.Interface, name, ns string) error

func DeleteStatefulSet

func DeleteStatefulSet(c clientset.Interface, name, ns string) error

func DeleteStorageClass

func DeleteStorageClass(c clientset.Interface, name string) error

func GetClusterRole

func GetClusterRole(ctx context.Context, c clientset.Interface, role string) (*v1.ClusterRole, error)

func GetClusterRoleBinding

func GetClusterRoleBinding(ctx context.Context, c clientset.Interface, rolebinding string) (*v1.ClusterRoleBinding, error)

func GetConfigmap

func GetConfigmap(c clientset.Interface, ns, name string) (*v1.ConfigMap, error)

func GetDaemonset

func GetDaemonset(c clientset.Interface, ns, name string) (*apps.DaemonSet, error)

func GetDeployment

func GetDeployment(c clientset.Interface, ns, name string) (*apps.Deployment, error)

func GetNamespace

func GetNamespace(ctx context.Context, c clientset.Interface, namespace string) (*corev1api.Namespace, error)

func GetPod

func GetPod(ctx context.Context, c clientset.Interface, namespace string, pod string) (*corev1.Pod, error)

func GetRole

func GetRole(ctx context.Context, c clientset.Interface, role, ns string) (*v1.Role, error)

func GetRoleBinding

func GetRoleBinding(ctx context.Context, c clientset.Interface, rolebinding, ns string) (*v1.RoleBinding, error)

func GetSecret

func GetSecret(c clientset.Interface, ns, secretName string) (*v1.Secret, error)

func GetService

func GetService(c clientset.Interface, name, namespace string) (*corev1.Service, error)

func GetServiceAccount

func GetServiceAccount(ctx context.Context, c clientset.Interface, ns string, serviceAccount string) (*corev1.ServiceAccount, error)

func GetStatefulset

func GetStatefulset(c clientset.Interface, ns, name string) (*apps.StatefulSet, error)

func GetStorageClass

func GetStorageClass(c clientset.Interface, name string) (*v1.StorageClass, error)

func NewConfigMap added in v1.0.1

func NewConfigMap() *v1.ConfigMap

func NewDaemonset

func NewDaemonset(name, ns string, labels map[string]string, image string) (*apps.DaemonSet, error)

func NewDaemonsetWithEnvFromConfigmap added in v1.0.1

func NewDaemonsetWithEnvFromConfigmap(name, ns string, labels map[string]string, image string, configName string) (*apps.DaemonSet, error)

func NewDaemonsetWithEnvFromSecret added in v1.0.1

func NewDaemonsetWithEnvFromSecret(name, ns string, labels map[string]string, image string, secretName string) (*apps.DaemonSet, error)

func NewDaemonsetWithEnvValConfigmap added in v1.0.1

func NewDaemonsetWithEnvValConfigmap(name, ns string, labels map[string]string, image string, configName string) (*apps.DaemonSet, error)

func NewDaemonsetWithEnvValSecret added in v1.0.1

func NewDaemonsetWithEnvValSecret(name, ns string, labels map[string]string, image string, secretName string) (*apps.DaemonSet, error)

func NewDeployment

func NewDeployment(name, ns string, replicas int32, labels map[string]string, image string) *apps.Deployment

newDeployment returns a RollingUpdate Deployment with a fake container image

func NewDeploymentWithEnvFromConfigmap added in v1.0.1

func NewDeploymentWithEnvFromConfigmap(name, ns string, replicas int32, labels map[string]string, image string, configName string) *apps.Deployment

deployment with configmap

func NewDeploymentWithEnvFromsecret added in v1.0.1

func NewDeploymentWithEnvFromsecret(name, ns string, replicas int32, labels map[string]string, image string, secretName string) *apps.Deployment

deployment with secret

func NewDeploymentWithEnvValConfigmap added in v1.0.1

func NewDeploymentWithEnvValConfigmap(name, ns string, replicas int32, labels map[string]string, image string, configName string) *apps.Deployment

NewDeploymentWithEnvValConfigmap

func NewDeploymentWithEnvValsecret added in v1.0.1

func NewDeploymentWithEnvValsecret(name, ns string, replicas int32, labels map[string]string, image string, secretName string) *apps.Deployment

func NewNameSpace

func NewNameSpace(c clientset.Interface, namespace string) *corev1api.Namespace

func NewPod added in v1.0.1

func NewPod() *corev1.Pod

func NewStatefulset

func NewStatefulset(name, ns string, replicas int32, labels map[string]string, image string) (*apps.StatefulSet, error)

func NewStatefulsetWithEnvFromConfigmap added in v1.0.1

func NewStatefulsetWithEnvFromConfigmap(name, ns string, replicas int32, labels map[string]string, image string, configName string) (*apps.StatefulSet, error)

NewStatefulsetWithConfigmap

func NewStatefulsetWithEnvFromSecret added in v1.0.1

func NewStatefulsetWithEnvFromSecret(name, ns string, replicas int32, labels map[string]string, image string, secretName string) (*apps.StatefulSet, error)

func NewStatefulsetWithEnvValConfigmap added in v1.0.1

func NewStatefulsetWithEnvValConfigmap(name, ns string, replicas int32, labels map[string]string, image string, configName string) (*apps.StatefulSet, error)

func NewStatefulsetWithEnvValSecret added in v1.0.1

func NewStatefulsetWithEnvValSecret(name, ns string, replicas int32, labels map[string]string, image string, secretName string) (*apps.StatefulSet, error)

func WaitForConfigMapComplete

func WaitForConfigMapComplete(c clientset.Interface, ns, configmapName string) error

WaitForConfigMapComplete uses c to wait for completions to complete for the Job jobName in namespace ns.

func WaitForConfigmapDelete

func WaitForConfigmapDelete(c clientset.Interface, ns, name string) error

func WaitForDaemonsetComplete

func WaitForDaemonsetComplete(c clientset.Interface, ns, name string) error

WaitForSecretsComplete uses c to wait for completions to complete for the Job jobName in namespace ns.

func WaitForDaemonsetDelete

func WaitForDaemonsetDelete(c clientset.Interface, ns, name string) error

func WaitForPodComplete

func WaitForPodComplete(c clientset.Interface, ns, name string) error

WaitForReadyPod waits for number of ready replicas to equal number of replicas.

func WaitForPodDelete

func WaitForPodDelete(c clientset.Interface, ns, name string) error

func WaitForReadyDeployment

func WaitForReadyDeployment(c clientset.Interface, ns, name string) error

WaitForReadyDeployment waits for number of ready replicas to equal number of replicas.

func WaitForSecretDelete

func WaitForSecretDelete(c clientset.Interface, ns, name string) error

func WaitForSecretsComplete

func WaitForSecretsComplete(c clientset.Interface, ns, secretName string) error

WaitForSecretsComplete uses c to wait for completions to complete for the Job jobName in namespace ns.

func WaitForStatefulsetComplete

func WaitForStatefulsetComplete(c clientset.Interface, ns, name string) error

WaitForSecretsComplete uses c to wait for completions to complete for the Job jobName in namespace ns.

func WaitForStatefulsetDelete

func WaitForStatefulsetDelete(c clientset.Interface, ns, name string) error

func WaitUntilServiceAccountCreated

func WaitUntilServiceAccountCreated(ctx context.Context, c clientset.Interface, namespace, serviceAccount string, timeout time.Duration) error

func WaitUntilServiceCreated

func WaitUntilServiceCreated(c clientset.Interface, ns, name string) error

func WaitUntilStorageClassCreated

func WaitUntilStorageClassCreated(c clientset.Interface, name 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