utils

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRetries = 40

MaxRetries is the maximum number of retries that a resource will be attempted to be fetched from the Kubernetes API Server.

View Source
const RetryInterval = 15

RetryInterval is the number of seconds to sleep in between requests to the Kubernetes API Server.

Variables

This section is empty.

Functions

func APIServerVersionInfo

func APIServerVersionInfo(t *testing.T, clientset *kubernetes.Clientset)

APIServerVersionInfo prints out the API Server versions.

func AssertAllNodesReady

func AssertAllNodesReady(t *testing.T, clientset *kubernetes.Clientset, desiredNodeCount int)

AssertAllNodesReady ensures that all Nodes are running & have a "Ready" status condition.

func AssertHTTPResultWithRetry added in v0.18.10

func AssertHTTPResultWithRetry(t *testing.T, output interface{}, headers map[string]string, maxWait time.Duration, check func(string) bool) bool

AssertHTTPResultWithRetry attempts to assert that an HTTP endpoint exists and evaluate its response.

func AssertKindInAllNamespacesReady added in v0.18.10

func AssertKindInAllNamespacesReady(t *testing.T, clientset *kubernetes.Clientset, name string)

AssertKindInAllNamespacesReady ensures all Deployments have valid & ready status conditions.

func AssertKindListIsReady added in v0.18.10

func AssertKindListIsReady(t *testing.T, clientset *kubernetes.Clientset, list interface{})

AssertKindListIsReady verifies that each item in a given resource list is marked as ready.

func IsDeploymentReady added in v0.18.10

func IsDeploymentReady(t *testing.T, clientset *kubernetes.Clientset, deployment *appsv1.Deployment) bool

IsDeploymentReady attempts to check if the Deployments's status conditions are ready.

func IsKubeconfigValid

func IsKubeconfigValid(kubeconfig []byte) error

IsKubeconfigValid checks that the kubeconfig provided is valid and error-free.

func IsNodeReady

func IsNodeReady(t *testing.T, clientset *kubernetes.Clientset, node *corev1.Node) bool

IsNodeReady attempts to check if the Node status condition is ready.

func IsPodReady

func IsPodReady(t *testing.T, clientset *kubernetes.Clientset, pod *corev1.Pod) bool

IsPodReady attempts to check if the Pod's status & condition is ready.

func IsReplicaSetReady added in v0.18.10

func IsReplicaSetReady(t *testing.T, clientset *kubernetes.Clientset, replicaSet *appsv1.ReplicaSet) bool

IsReplicaSetReady attempts to check if the ReplicaSets's status conditions are ready.

func PrintAndLog added in v0.18.10

func PrintAndLog(s string, t *testing.T)

PrintAndLog is a helper fucn that prints a string to stdout, and logs it to the testing logs.

func RunEKSSmokeTest

func RunEKSSmokeTest(t *testing.T, resources []apitype.ResourceV3, kubeconfigs ...interface{})

RunEKSSmokeTest instantiates the EKS Smoke Test.

Types

type KubeAccess

type KubeAccess struct {
	RESTConfig *restclient.Config
	Clientset  *kubernetes.Clientset
}

KubeAccess holds the Kubernetes client-go client bag of tools to work with the APIServer: the RESTConfig, and Clientset for the various API groups.

func KubeconfigToKubeAccess

func KubeconfigToKubeAccess(kubeconfig []byte) (*KubeAccess, error)

KubeconfigToKubeAccess creates a KubeAccess object from a serialized kubeconfig.

Jump to

Keyboard shortcuts

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