testutil

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ConfigmapResourceType is a resource type which controller watches for changes
	ConfigmapResourceType = "configMaps"
	// SecretResourceType is a resource type which controller watches for changes
	SecretResourceType = "secrets"
)

Functions

func ConvertResourceToSHA

func ConvertResourceToSHA(resourceType string, namespace string, resourceName string, data string) string

ConvertResourceToSHA generates SHA from secret or configmap data

func CreateConfigMap

func CreateConfigMap(client kubernetes.Interface, namespace string, configmapName string, data string) (core_v1.ConfigMapInterface, error)

CreateConfigMap creates a configmap in given namespace and returns the ConfigMapInterface

func CreateDaemonSet

func CreateDaemonSet(client kubernetes.Interface, daemonsetName string, namespace string, volumeMount bool) (*v1beta1.DaemonSet, error)

CreateDaemonSet creates a deployment in given namespace and returns the DaemonSet

func CreateDeployment

func CreateDeployment(client kubernetes.Interface, deploymentName string, namespace string, volumeMount bool) (*v1beta1.Deployment, error)

CreateDeployment creates a deployment in given namespace and returns the Deployment

func CreateDeploymentConfig added in v0.0.37

func CreateDeploymentConfig(client appsclient.Interface, deploymentName string, namespace string, volumeMount bool) (*openshiftv1.DeploymentConfig, error)

CreateDeploymentConfig creates a deploymentConfig in given namespace and returns the DeploymentConfig

func CreateDeploymentWithEnvVarSource added in v0.0.23

func CreateDeploymentWithEnvVarSource(client kubernetes.Interface, deploymentName string, namespace string) (*v1beta1.Deployment, error)

CreateDeploymentWithEnvVarSource creates a deployment in given namespace and returns the Deployment

func CreateDeploymentWithInitContainer added in v0.0.26

func CreateDeploymentWithInitContainer(client kubernetes.Interface, deploymentName string, namespace string, volumeMount bool) (*v1beta1.Deployment, error)

CreateDeploymentWithInitContainer creates a deployment in given namespace with init container and returns the Deployment

func CreateNamespace

func CreateNamespace(namespace string, client kubernetes.Interface)

CreateNamespace creates namespace for testing

func CreateSecret

func CreateSecret(client kubernetes.Interface, namespace string, secretName string, data string) (core_v1.SecretInterface, error)

CreateSecret creates a secret in given namespace and returns the SecretInterface

func CreateStatefulSet

func CreateStatefulSet(client kubernetes.Interface, statefulsetName string, namespace string, volumeMount bool) (*v1_beta1.StatefulSet, error)

CreateStatefulSet creates a deployment in given namespace and returns the StatefulSet

func DeleteConfigMap

func DeleteConfigMap(client kubernetes.Interface, namespace string, configmapName string) error

DeleteConfigMap deletes a configmap in given namespace and returns the error if any

func DeleteDaemonSet

func DeleteDaemonSet(client kubernetes.Interface, namespace string, daemonsetName string) error

DeleteDaemonSet creates a daemonset in given namespace and returns the error if any

func DeleteDeployment

func DeleteDeployment(client kubernetes.Interface, namespace string, deploymentName string) error

DeleteDeployment creates a deployment in given namespace and returns the error if any

func DeleteDeploymentConfig added in v0.0.37

func DeleteDeploymentConfig(client appsclient.Interface, namespace string, deploymentConfigName string) error

DeleteDeploymentConfig deletes a deploymentConfig in given namespace and returns the error if any

func DeleteNamespace

func DeleteNamespace(namespace string, client kubernetes.Interface)

DeleteNamespace deletes namespace for testing

func DeleteSecret

func DeleteSecret(client kubernetes.Interface, namespace string, secretName string) error

DeleteSecret deletes a secret in given namespace and returns the error if any

func DeleteStatefulSet

func DeleteStatefulSet(client kubernetes.Interface, namespace string, statefulsetName string) error

DeleteStatefulSet creates a statefulset in given namespace and returns the error if any

func GetConfigmap

func GetConfigmap(namespace string, configmapName string, testData string) *v1.ConfigMap

GetConfigmap provides configmap for testing

func GetConfigmapWithUpdatedLabel

func GetConfigmapWithUpdatedLabel(namespace string, configmapName string, testLabel string, testData string) *v1.ConfigMap

GetConfigmapWithUpdatedLabel provides configmap for testing

func GetDaemonSet

func GetDaemonSet(namespace string, daemonsetName string) *v1beta1.DaemonSet

GetDaemonSet provides daemonset for testing

func GetDaemonSetWithEnvVars added in v0.0.22

func GetDaemonSetWithEnvVars(namespace string, daemonSetName string) *v1beta1.DaemonSet

func GetDeployment

func GetDeployment(namespace string, deploymentName string) *v1beta1.Deployment

GetDeployment provides deployment for testing

func GetDeploymentConfig added in v0.0.37

func GetDeploymentConfig(namespace string, deploymentConfigName string) *openshiftv1.DeploymentConfig

GetDeploymentConfig provides deployment for testing

func GetDeploymentConfigWithEnvVars added in v0.0.37

func GetDeploymentConfigWithEnvVars(namespace string, deploymentConfigName string) *openshiftv1.DeploymentConfig

func GetDeploymentWithEnvVarSources added in v0.0.23

func GetDeploymentWithEnvVarSources(namespace string, deploymentName string) *v1beta1.Deployment

func GetDeploymentWithEnvVars added in v0.0.22

func GetDeploymentWithEnvVars(namespace string, deploymentName string) *v1beta1.Deployment

func GetDeploymentWithInitContainer added in v0.0.26

func GetDeploymentWithInitContainer(namespace string, deploymentName string) *v1beta1.Deployment

GetDeploymentWithInitContainer provides deployment with init container and volumeMounts

func GetDeploymentWithInitContainerAndEnv added in v0.0.26

func GetDeploymentWithInitContainerAndEnv(namespace string, deploymentName string) *v1beta1.Deployment

GetDeploymentWithInitContainerAndEnv provides deployment with init container and EnvSource

func GetResourceSHA

func GetResourceSHA(containers []v1.Container, envar string) string

GetResourceSHA returns the SHA value of given environment variable

func GetSecret

func GetSecret(namespace string, secretName string, data string) *v1.Secret

GetSecret provides secret for testing

func GetSecretWithUpdatedLabel

func GetSecretWithUpdatedLabel(namespace string, secretName string, label string, data string) *v1.Secret

GetSecretWithUpdatedLabel provides secret for testing

func GetStatefulSet

func GetStatefulSet(namespace string, statefulsetName string) *v1_beta1.StatefulSet

GetStatefulSet provides statefulset for testing

func GetStatefulSetWithEnvVar added in v0.0.22

func GetStatefulSetWithEnvVar(namespace string, statefulsetName string) *v1_beta1.StatefulSet

GetStatefulSet provides statefulset for testing

func RandSeq

func RandSeq(n int) string

RandSeq generates a random sequence

func UpdateConfigMap

func UpdateConfigMap(configmapClient core_v1.ConfigMapInterface, namespace string, configmapName string, label string, data string) error

UpdateConfigMap updates a configmap in given namespace and returns the error if any

func UpdateSecret

func UpdateSecret(secretClient core_v1.SecretInterface, namespace string, secretName string, label string, data string) error

UpdateSecret updates a secret in given namespace and returns the error if any

func VerifyResourceUpdate

func VerifyResourceUpdate(clients kube.Clients, config util.Config, envVarPostfix string, upgradeFuncs callbacks.RollingUpgradeFuncs) bool

VerifyResourceUpdate verifies whether the rolling upgrade happened or not

Types

This section is empty.

Jump to

Keyboard shortcuts

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