cluster

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var By = ginkgo.By

By is an alias to ginkgo.By

Functions

func DeleteNamespace

func DeleteNamespace(namespaces corev1.NamespaceInterface, ns string, waitForDeletion bool) error

DeleteNamespace deletes a namespace

Types

type Namespace

type Namespace struct {
	// contains filtered or unexported fields
}

Namespace is a test dedicated namespace

func CreateNamespace

func CreateNamespace(createConfig, config *rest.Config, name string) (*Namespace, func(), error)

CreateNamespace creates a namespace

func (*Namespace) As added in v0.4.18

As returns the same namespace with an impersonated config

func (*Namespace) ConfigMaps

func (ns *Namespace) ConfigMaps() corev1.ConfigMapInterface

ConfigMaps returns a ConfigMaps client for the namespace

func (*Namespace) ContainsNPods

func (ns *Namespace) ContainsNPods(count int) wait.ConditionFunc

ContainsNPods is a poller that checks how many pods are created.

func (*Namespace) ContainsNPodsMatchingSelector

func (ns *Namespace) ContainsNPodsMatchingSelector(count int, labelSelector string) wait.ConditionFunc

ContainsNPodsMatchingSelector is a poller that checks how many pods are created for given label selector.

func (*Namespace) ContainsNPodsWithPredicate

func (ns *Namespace) ContainsNPodsWithPredicate(count int, labelSelector string, predicate PodPredicate) wait.ConditionFunc

ContainsNPodsWithPredicate is a poller that checks how many pods matching the predicate are created.

func (*Namespace) ContainsNStacks

func (ns *Namespace) ContainsNStacks(count int) wait.ConditionFunc

ContainsNStacks is a poller that checks how many stacks are created.

func (*Namespace) ContainsZeroPod

func (ns *Namespace) ContainsZeroPod() wait.ConditionFunc

ContainsZeroPod is a poller that checks that no pod is created.

func (*Namespace) ContainsZeroStack

func (ns *Namespace) ContainsZeroStack() wait.ConditionFunc

ContainsZeroStack is a poller that checks that no stack is created.

func (*Namespace) CreatePullSecret added in v0.4.19

func (ns *Namespace) CreatePullSecret(name, server, username, password string) error

CreatePullSecret creates a pull secret

func (*Namespace) CreateStack

func (ns *Namespace) CreateStack(strategy StackOperationStrategy, name, composeFile string) (*v1alpha3.Stack, error)

CreateStack creates a stack.

func (*Namespace) DeleteStack

func (ns *Namespace) DeleteStack(name string) error

DeleteStack deletes a stack.

func (*Namespace) DeleteStackWithPropagation added in v0.4.19

func (ns *Namespace) DeleteStackWithPropagation(name string, propagation metav1.DeletionPropagation) error

DeleteStackWithPropagation deletes a stack using the specified propagation.

func (*Namespace) DeleteStacks

func (ns *Namespace) DeleteStacks() error

DeleteStacks deletes all stacks.

func (*Namespace) DeleteStacksv1

func (ns *Namespace) DeleteStacksv1() error

DeleteStacksv1 deletes all stacks.

func (*Namespace) DeleteStackv1

func (ns *Namespace) DeleteStackv1(name string) error

DeleteStackv1 deletes a stack.

func (*Namespace) Deployments

func (ns *Namespace) Deployments() typesappsv1.DeploymentInterface

Deployments returns a DeploymentInterface

func (*Namespace) GetStack

func (ns *Namespace) GetStack(name string) (*v1alpha3.Stack, error)

GetStack gets a stack.

func (*Namespace) HasStorageClass

func (ns *Namespace) HasStorageClass() (bool, error)

HasStorageClass returns true if cluster has at least one StorageClass defined

func (*Namespace) IsServiceNotPresent

func (ns *Namespace) IsServiceNotPresent(labelSelector string) wait.ConditionFunc

IsServiceNotPresent is a poller that checks if a service is not present.

func (*Namespace) IsServicePresent

func (ns *Namespace) IsServicePresent(labelSelector string) wait.ConditionFunc

IsServicePresent is a poller that checks if a service is present.

func (*Namespace) IsServiceResponding

func (ns *Namespace) IsServiceResponding(service string, url string, expectedText string) wait.ConditionFunc

IsServiceResponding is a poller that checks is responding with the expected content text.

func (*Namespace) IsStackAvailable

func (ns *Namespace) IsStackAvailable(name string) wait.ConditionFunc

IsStackAvailable is a poller that checks is a given stack is available.

func (*Namespace) IsStackFailed

func (ns *Namespace) IsStackFailed(name string, errorSubstr string) wait.ConditionFunc

IsStackFailed is a poller that checks if a given stack has failed with the correct error.

func (*Namespace) ListAllPods

func (ns *Namespace) ListAllPods() ([]apiv1.Pod, error)

ListAllPods lists all pods in the namespace.

func (*Namespace) ListDeployments

func (ns *Namespace) ListDeployments(labelSelector string) ([]appsv1.Deployment, error)

ListDeployments lists the deployments that match a given selector.

func (*Namespace) ListNodes

func (ns *Namespace) ListNodes() ([]apiv1.Node, error)

ListNodes lists the nodes available in the cluster.

func (*Namespace) ListPods

func (ns *Namespace) ListPods(labelSelector string) ([]apiv1.Pod, error)

ListPods lists the pods that match a given selector.

func (*Namespace) ListServices

func (ns *Namespace) ListServices(labelSelector string) ([]apiv1.Service, error)

ListServices lists the services that match a given selector.

func (*Namespace) ListStacks

func (ns *Namespace) ListStacks() ([]v1alpha3.Stack, error)

ListStacks lists the stacks.

func (*Namespace) Name

func (ns *Namespace) Name() string

Name returns the name of the namespace.

func (*Namespace) PodIsActuallyRemoved

func (ns *Namespace) PodIsActuallyRemoved(name string) wait.ConditionFunc

PodIsActuallyRemoved is a poller that checks that a pod has been terminated

func (*Namespace) Pods

func (ns *Namespace) Pods() corev1.PodInterface

Pods returns a PodInterface

func (*Namespace) RESTClientV1alpha3 added in v0.4.19

func (ns *Namespace) RESTClientV1alpha3() rest.Interface

RESTClientV1alpha3 returns a RESTClient for the stacks

func (*Namespace) RESTClientV1beta2 added in v0.4.19

func (ns *Namespace) RESTClientV1beta2() rest.Interface

RESTClientV1beta2 returns a RESTClient for the stacks

func (*Namespace) Secrets

func (ns *Namespace) Secrets() corev1.SecretInterface

Secrets returns a Secrets client for the namespace

func (*Namespace) ServiceCount

func (ns *Namespace) ServiceCount(labelSelector string, count int) wait.ConditionFunc

ServiceCount is a poller that checks a number of services to be present.

func (*Namespace) Services added in v0.4.21

func (ns *Namespace) Services() corev1.ServiceInterface

Services returns a Services client for the namespace

func (*Namespace) StacksV1alpha3 added in v0.4.19

func (ns *Namespace) StacksV1alpha3() composev1alpha3.StackInterface

StacksV1alpha3 returns a v1alpha3 client

func (*Namespace) StacksV1beta1

func (ns *Namespace) StacksV1beta1() composev1beta1.StackInterface

StacksV1beta1 returns a v1beta1 client

func (*Namespace) UpdateStack

func (ns *Namespace) UpdateStack(strategy StackOperationStrategy, name, composeFile string) (*v1alpha3.Stack, error)

UpdateStack updates a stack.

func (*Namespace) UpdateStackFromSpec

func (ns *Namespace) UpdateStackFromSpec(name string, newStack *v1alpha3.Stack) (*v1alpha3.Stack, error)

UpdateStackFromSpec updates a stack from a Spec.

type PodPredicate

type PodPredicate func(pod apiv1.Pod) (bool, string)

PodPredicate returns true when a predicate is verified on a pod and an optional message indicating why the predicate is false

type StackOperationStrategy

type StackOperationStrategy int

StackOperationStrategy is the strategy for a stack create/update

const (
	//StackOperationV1beta1 will use v1beta1 API
	StackOperationV1beta1 StackOperationStrategy = iota
	//StackOperationV1beta2Compose will use v1beta2 composefile subresource
	StackOperationV1beta2Compose
	//StackOperationV1beta2Stack will use v1beta2 structured stack
	StackOperationV1beta2Stack
	//StackOperationV1alpha3 will use a v1alpha3 structured stack
	StackOperationV1alpha3
)

Jump to

Keyboard shortcuts

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