testing

package
v0.0.0-...-9aa4a0e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testing provides support for automated testing of nats-operator-doctor.

Package testing provides support for automated testing of nats-operator-doctor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeployment

func GetDeployment(name, namespace string, opts ...Option) *appsv1.Deployment

GetDeployment returns a new Kubernetes Deployment instance.

func GetDeploymentIfNil

func GetDeploymentIfNil(deployment *appsv1.Deployment) *appsv1.Deployment

GetDeploymentIfNil returns a new Kubernetes Deployment instance if the given one is nil.

func GetNatsCluster

func GetNatsCluster(name, namespace string, size int) *v1alpha2.NatsCluster

GetNatsCluster returns a new NatsCluster instance.

func GetNatsClusterIfNil

func GetNatsClusterIfNil(natsCluster *v1alpha2.NatsCluster) *v1alpha2.NatsCluster

GetNatsClusterIfNil returns a new NatsCluster instance if the given one is nil.

func GetNatsClusterList

func GetNatsClusterList(natsClusters ...v1alpha2.NatsCluster) *v1alpha2.NatsClusterList

GetNatsClusterList returns a new NatsClusterList instance.

func GetPod

func GetPod(name, namespace string, opts ...Option) *v1.Pod

GetPod returns a new Kubernetes Pod instance.

func GetPodIfNil

func GetPodIfNil(pod *v1.Pod) *v1.Pod

GetPodIfNil returns a new Kubernetes Pod instance if the given one is nil.

func GetSecret

func GetSecret(name, namespace string, opts ...Option) *v1.Secret

GetSecret returns a new Kubernetes Secret instance.

func PodsToRuntimeObjects

func PodsToRuntimeObjects(pods []*v1.Pod) []runtime.Object

PodsToRuntimeObjects returns an array of runtime objects from the given pods.

func SecretsToRuntimeObjects

func SecretsToRuntimeObjects(secrets []*v1.Secret) []runtime.Object

SecretsToRuntimeObjects returns an array of runtime objects from the given secrets.

Types

type Option

type Option func(runtime.Object)

Option represents a function that can operate on a Kubernetes runtime object.

func DeploymentWithReplicas

func DeploymentWithReplicas(replicas int32) Option

DeploymentWithReplicas returns an option function that should update a Kubernetes Deployment with the given replicas.

func PodWithLabel

func PodWithLabel(key, value string) Option

PodWithLabel returns an option function that should label a Kubernetes Pod with the given key and value.

func PodWithPhase

func PodWithPhase(phase v1.PodPhase) Option

PodWithPhase returns an option function that should update a Kubernetes Pod with the given phase.

func SecretWithLabel

func SecretWithLabel(key, value string) Option

SecretWithLabel returns an option function that should label a Kubernetes Secret.

Jump to

Keyboard shortcuts

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