cluster

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 24 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) CreateStack

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

CreateStack creates a stack.

func (*Namespace) DeleteStack

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

DeleteStack deletes a stack.

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

Deployments returns a DeploymentInterface

func (*Namespace) GetStack

func (ns *Namespace) GetStack(name string) (*apiv1beta2.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) ([]appsv1beta2.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() ([]apiv1beta2.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) RESTClient

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

RESTClient 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) StacksV1beta1

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

StacksV1beta1 returns a v1beta1 client

func (*Namespace) UpdateStack

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

UpdateStack updates a stack.

func (*Namespace) UpdateStackFromSpec

func (ns *Namespace) UpdateStackFromSpec(name string, newStack *apiv1beta2.Stack) (*apiv1beta2.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
)

Jump to

Keyboard shortcuts

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