environment

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCRDs added in v0.4.2

func ApplyCRDs(kubeConfig *rest.Config) error

ApplyCRDs applies the CRDs to the cluster

Types

type Environment

type Environment struct {
	*utils.Environment
	Machine
	testing.Catalog
}

Environment starts our operator and handles interaction with the k8s cluster used in the tests

func NewEnvironment

func NewEnvironment(kubeConfig *rest.Config) *Environment

NewEnvironment returns a new struct

func (*Environment) NodeIP added in v0.4.2

func (e *Environment) NodeIP() (string, error)

NodeIP returns a public IP of a node

func (*Environment) SetupClientsets added in v0.4.2

func (e *Environment) SetupClientsets() error

SetupClientsets initializes kube clientsets

func (*Environment) SetupNamespace added in v0.4.2

func (e *Environment) SetupNamespace() error

SetupNamespace creates the namespace and the clientsets and prepares the teardowm

func (*Environment) SetupQjobAccount added in v1.0.0

func (e *Environment) SetupQjobAccount() error

func (*Environment) StartOperator added in v0.4.2

func (e *Environment) StartOperator() error

StartOperator prepares and starts the cf-operator

type Machine

type Machine struct {
	machine.Machine

	VersionedClientset *versioned.Clientset
}

Machine produces and destroys resources for tests

func (*Machine) CollectDeployment added in v1.0.0

func (m *Machine) CollectDeployment(namespace string, name string, generation int64) (*appsv1.Deployment, error)

CollectDeployment waits for deployment with generation > x to appear, then returns it

func (*Machine) CollectStatefulSet added in v1.0.0

func (m *Machine) CollectStatefulSet(namespace string, name string, generation int64) (*appsv1.StatefulSet, error)

CollectStatefulSet waits for statefulset with generation > x to appear, then returns it

func (*Machine) CreateBOSHDeployment

func (m *Machine) CreateBOSHDeployment(namespace string, deployment bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, machine.TearDownFunc, error)

CreateBOSHDeployment creates a BOSHDeployment custom resource and returns a function to delete it

func (*Machine) CreateBOSHDeploymentUsingChan added in v0.3.1

func (m *Machine) CreateBOSHDeploymentUsingChan(outputChannel chan machine.ChanResult, namespace string, deployment bdv1.BOSHDeployment)

CreateBOSHDeploymentUsingChan creates a BOSHDeployment custom resource and returns an error via a channel

func (*Machine) CreateDeployment added in v1.0.0

func (m *Machine) CreateDeployment(namespace string, res appsv1.Deployment) (machine.TearDownFunc, error)

CreateDeployment creates a statefulset and returns a function to delete it

func (*Machine) CreatePodWithTailLogsContainer added in v0.4.0

func (m *Machine) CreatePodWithTailLogsContainer(podName string, parentPodCmd string, parentCName string, sidecardCName string,
	dockerImg string) corev1.Pod

CreatePodWithTailLogsContainer will generate a pod with two containers One is the parent container that will execute a cmd, preferrable something that writes into files under /var/vcap/sys/log The side-car container, will be tailing the logs of specific files under /var/vcap/sys/log, by running the cf-operator util tail-logs subcmommand

func (*Machine) CreateQuarksSecret added in v1.0.0

func (m *Machine) CreateQuarksSecret(namespace string, qs qsv1a1.QuarksSecret) (*qsv1a1.QuarksSecret, machine.TearDownFunc, error)

CreateQuarksSecret creates a QuarksSecret custom resource and returns a function to delete it

func (*Machine) CreateQuarksStatefulSet added in v1.0.0

func (m *Machine) CreateQuarksStatefulSet(namespace string, ess qstsv1a1.QuarksStatefulSet) (*qstsv1a1.QuarksStatefulSet, machine.TearDownFunc, error)

CreateQuarksStatefulSet creates a QuarksStatefulSet custom resource and returns a function to delete it

func (*Machine) CreateStatefulSet added in v1.0.0

func (m *Machine) CreateStatefulSet(namespace string, res appsv1.StatefulSet) (machine.TearDownFunc, error)

CreateStatefulSet creates a statefulset and returns a function to delete it

func (*Machine) DeleteBOSHDeployment

func (m *Machine) DeleteBOSHDeployment(namespace string, name string) error

DeleteBOSHDeployment deletes a BOSHDeployment custom resource

func (*Machine) DeleteQuarksSecret added in v1.0.0

func (m *Machine) DeleteQuarksSecret(namespace string, name string) error

DeleteQuarksSecret deletes an QuarksSecret custom resource

func (*Machine) DeleteQuarksStatefulSet added in v1.0.0

func (m *Machine) DeleteQuarksStatefulSet(namespace string, name string) error

DeleteQuarksStatefulSet deletes a QuarksStatefulSet custom resource

func (*Machine) ExecPodCMD added in v1.0.0

func (m *Machine) ExecPodCMD(client kubernetes.Interface, rc *rest.Config, pod *corev1.Pod, container string, command []string) (bool, error)

ExecPodCMD executes a cmd in a container

func (*Machine) GetBOSHDeployment

func (m *Machine) GetBOSHDeployment(namespace string, name string) (*bdv1.BOSHDeployment, error)

GetBOSHDeployment gets a BOSHDeployment custom resource

func (*Machine) GetInstanceGroupPods added in v0.3.0

func (m *Machine) GetInstanceGroupPods(namespace string, deployment string, igName string) (*corev1.PodList, error)

GetInstanceGroupPods returns all pods from a specific instance group version

func (*Machine) GetNamespaceEvents added in v1.0.0

func (m *Machine) GetNamespaceEvents(namespace, name, id, reason, msg string) (bool, error)

GetNamespaceEvents exits as soon as an event reason and msg matches

func (*Machine) GetQuarksStatefulSet added in v1.0.0

func (m *Machine) GetQuarksStatefulSet(namespace string, name string) (*qstsv1a1.QuarksStatefulSet, error)

GetQuarksStatefulSet gets a QuarksStatefulSet custom resource

func (*Machine) GetStatefulSet

func (m *Machine) GetStatefulSet(namespace string, name string) (*appsv1.StatefulSet, error)

GetStatefulSet gets a StatefulSet by namespace and name

func (*Machine) HasBOSHDeployment

func (m *Machine) HasBOSHDeployment(namespace string, name string) (bool, error)

HasBOSHDeployment returns true if the pod by that name is in state running

func (*Machine) PVAvailable

func (m *Machine) PVAvailable(name string) (bool, error)

PVAvailable returns true if the pv by that name is in state available

func (*Machine) PVCsDeleted

func (m *Machine) PVCsDeleted(namespace string) (bool, error)

PVCsDeleted returns true if the all pvs are deleted

func (*Machine) PVsDeleted

func (m *Machine) PVsDeleted(labels string) (bool, error)

PVsDeleted returns true if the all pvs are deleted

func (*Machine) PatchPod added in v1.0.0

func (m *Machine) PatchPod(namespace string, name string, o string, p string, v string) error

PatchPod applies a patch into a specific pod operation can be of the form add,remove,replace See https://tools.ietf.org/html/rfc6902 for more information

func (*Machine) PodLabelToExist added in v1.0.0

func (m *Machine) PodLabelToExist(n string, podName string, label string) (bool, error)

PodLabelToExist returns true if the label exist in the specified pod

func (*Machine) PodLabelToNotExist added in v1.0.0

func (m *Machine) PodLabelToNotExist(n string, podName string, label string) (bool, error)

PodLabelToNotExist returns true if the label does not exist

func (*Machine) QuarksStatefulSetExists added in v1.0.0

func (m *Machine) QuarksStatefulSetExists(namespace string, labels string) (bool, error)

QuarksStatefulSetExists returns true if at least one ess selected by labels exists

func (*Machine) StatefulSetExist added in v0.2.1

func (m *Machine) StatefulSetExist(namespace string, name string) (bool, error)

StatefulSetExist checks if the statefulSet exists

func (*Machine) StatefulSetNewGeneration

func (m *Machine) StatefulSetNewGeneration(namespace string, name string, generation int64) (bool, error)

StatefulSetNewGeneration returns true if StatefulSet has a new generation greater `generation`

func (*Machine) StatefulSetRunning

func (m *Machine) StatefulSetRunning(namespace string, name string) (bool, error)

StatefulSetRunning returns true if the statefulSet by that name has all pods created

func (*Machine) UpdateBOSHDeployment

func (m *Machine) UpdateBOSHDeployment(namespace string, deployment bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, machine.TearDownFunc, error)

UpdateBOSHDeployment creates a BOSHDeployment custom resource and returns a function to delete it

func (*Machine) UpdateQuarksStatefulSet added in v1.0.0

func (m *Machine) UpdateQuarksStatefulSet(namespace string, ess qstsv1a1.QuarksStatefulSet) (*qstsv1a1.QuarksStatefulSet, machine.TearDownFunc, error)

UpdateQuarksStatefulSet updates a QuarksStatefulSet custom resource and returns a function to delete it

func (*Machine) WaitForBOSHDeploymentDeletion

func (m *Machine) WaitForBOSHDeploymentDeletion(namespace string, name string) error

WaitForBOSHDeploymentDeletion blocks until the CR is deleted

func (*Machine) WaitForDeployment added in v1.0.0

func (m *Machine) WaitForDeployment(namespace string, name string, generation int64) error

WaitForDeployment waits for deployment with generation > x to appear

func (*Machine) WaitForInstanceGroup added in v0.3.0

func (m *Machine) WaitForInstanceGroup(namespace string, deployment string, igName string, version string, count int) error

WaitForInstanceGroup blocks until all selected pods of the instance group are running. It fails after the timeout.

func (*Machine) WaitForInstanceGroupVersionAllReplicas added in v1.0.0

func (m *Machine) WaitForInstanceGroupVersionAllReplicas(namespace string, deployment string, igName string, count int, versions ...string) error

WaitForInstanceGroupVersionAllReplicas blocks until all selected pods of the instance group are running. It fails after the timeout.

func (*Machine) WaitForPV

func (m *Machine) WaitForPV(name string) error

WaitForPV blocks until the pv is running. It fails after the timeout.

func (*Machine) WaitForPVCsDelete

func (m *Machine) WaitForPVCsDelete(namespace string) error

WaitForPVCsDelete blocks until the pvc is deleted. It fails after the timeout.

func (*Machine) WaitForPVsDelete

func (m *Machine) WaitForPVsDelete(labels string) error

WaitForPVsDelete blocks until the pv is deleted. It fails after the timeout.

func (*Machine) WaitForPodLabelToExist added in v1.0.0

func (m *Machine) WaitForPodLabelToExist(n string, podName string, label string) error

WaitForPodLabelToExist blocks until the specified label appears

func (*Machine) WaitForPodLabelToNotExist added in v1.0.0

func (m *Machine) WaitForPodLabelToNotExist(n string, podName string, label string) error

WaitForPodLabelToNotExist blocks until the specified label is not present

func (*Machine) WaitForQuarksStatefulSets added in v1.0.0

func (m *Machine) WaitForQuarksStatefulSets(namespace string, labels string) error

WaitForQuarksStatefulSets blocks until at least one QuarksStatefulSet is found. It fails after the timeout.

func (*Machine) WaitForServiceVersion added in v1.0.0

func (m *Machine) WaitForServiceVersion(namespace string, serviceName string, version string) error

WaitForServiceVersion blocks until the service of the instance group is created/updated. It fails after the timeout.

func (*Machine) WaitForStatefulSet

func (m *Machine) WaitForStatefulSet(namespace string, name string) error

WaitForStatefulSet blocks until all statefulSet pods are running. It fails after the timeout.

func (*Machine) WaitForStatefulSetDelete added in v0.2.1

func (m *Machine) WaitForStatefulSetDelete(namespace string, name string) error

WaitForStatefulSetDelete blocks until the specified statefulSet is deleted

func (*Machine) WaitForStatefulSetNewGeneration

func (m *Machine) WaitForStatefulSetNewGeneration(namespace string, name string, currentVersion int64) error

WaitForStatefulSetNewGeneration blocks until at least one StatefulSet is found, which has a generation greater than currentVersion. It fails after the timeout.

type QuarksJobCmd added in v1.0.0

type QuarksJobCmd struct {
	Path string
}

QuarksJobCmd helps to run the QuarksJob operator in tests

func NewQuarksJobCmd added in v1.0.0

func NewQuarksJobCmd() QuarksJobCmd

NewQuarksJobCmd returns the default QuarksJobCmd

func (*QuarksJobCmd) Build added in v1.0.0

func (q *QuarksJobCmd) Build() error

Build builds the quarks-job operator binary

func (*QuarksJobCmd) Start added in v1.0.0

func (q *QuarksJobCmd) Start(namespace string) error

Start starts the specified quarks-job in a namespace

Jump to

Keyboard shortcuts

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