Documentation ¶
Overview ¶
Package environment for setting up the integration test environment
Index ¶
- func ApplyCRDs(kubeConfig *rest.Config) error
- func NukeWebhooks(namespacesToNuke []string)
- func Teardown(e *Environment, wasFailure bool)
- type Environment
- func (e *Environment) NodeIP() (string, error)
- func (e *Environment) QStsPort() int32
- func (e *Environment) SetupClientsets() error
- func (e *Environment) SetupNamespace() error
- func (e *Environment) SetupPort() error
- func (e *Environment) SetupQjobAccount() error
- func (e *Environment) SetupServiceAccount() error
- func (e *Environment) StartOperator() error
- type Machine
- func (m *Machine) CollectDeployment(namespace string, name string, generation int64) (*appsv1.Deployment, error)
- func (m *Machine) CollectStatefulSet(namespace string, name string, generation int64) (*appsv1.StatefulSet, error)
- func (m *Machine) CreateBOSHDeployment(namespace string, deployment bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, machine.TearDownFunc, error)
- func (m *Machine) CreateBOSHDeploymentUsingChan(outputChannel chan machine.ChanResult, namespace string, ...)
- func (m *Machine) CreateDeployment(namespace string, res appsv1.Deployment) (machine.TearDownFunc, error)
- func (m *Machine) CreateStatefulSet(namespace string, res appsv1.StatefulSet) (machine.TearDownFunc, error)
- func (m *Machine) DeleteBOSHDeployment(namespace string, name string) error
- func (m *Machine) EnvKeys(containers []corev1.Container) []string
- func (m *Machine) ExecPodCMD(client kubernetes.Interface, rc *rest.Config, pod *corev1.Pod, ...) (bool, error)
- func (m *Machine) GetBOSHDeployment(namespace string, name string) (*bdv1.BOSHDeployment, error)
- func (m *Machine) GetInstanceGroupPods(namespace string, deployment string, igName string) (*corev1.PodList, error)
- func (m *Machine) GetNamespaceEvents(namespace, name, id, reason, msg string) (bool, error)
- func (m *Machine) GetStatefulSet(namespace string, name string) (*appsv1.StatefulSet, error)
- func (m *Machine) GetStatefulSetByInstanceGroup(namespace string, name string, versions []string) (*appsv1.StatefulSet, error)
- func (m *Machine) GetStatefulSetByInstanceGroupName(namespace string, name string) (*appsv1.StatefulSet, error)
- func (m *Machine) HasBOSHDeployment(namespace string, name string) (bool, error)
- func (m *Machine) PVAvailable(name string) (bool, error)
- func (m *Machine) PVCsDeleted(namespace string) (bool, error)
- func (m *Machine) PVsDeleted(labels string) (bool, error)
- func (m *Machine) PatchPod(namespace string, name string, o string, p string, v string) error
- func (m *Machine) PodLabelToExist(n string, podName string, label string) (bool, error)
- func (m *Machine) PodLabelToNotExist(n string, podName string, label string) (bool, error)
- func (m *Machine) QuarksStatefulSetExists(namespace string, name string) (bool, error)
- func (m *Machine) StatefulSetExist(namespace string, name string) (bool, error)
- func (m *Machine) StatefulSetNewGeneration(namespace string, name string, generation int64) (bool, error)
- func (m *Machine) StatefulSetRunning(namespace string, name string) (bool, error)
- func (m *Machine) UpdateBOSHDeployment(namespace string, deployment bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, machine.TearDownFunc, error)
- func (m *Machine) WaitForBOSHDeploymentDeletion(namespace string, name string) error
- func (m *Machine) WaitForDeployment(namespace string, name string, generation int64) error
- func (m *Machine) WaitForInstanceGroup(namespace string, deployment string, igName string, count int) error
- func (m *Machine) WaitForInstanceGroupVersions(namespace string, deployment string, igName string, count int, ...) error
- func (m *Machine) WaitForPV(name string) error
- func (m *Machine) WaitForPVCsDelete(namespace string) error
- func (m *Machine) WaitForPVsDelete(labels string) error
- func (m *Machine) WaitForPodLabelToExist(n string, podName string, label string) error
- func (m *Machine) WaitForPodLabelToNotExist(n string, podName string, label string) error
- func (m *Machine) WaitForQuarksStatefulSetDelete(namespace string, name string) error
- func (m *Machine) WaitForServiceVersion(namespace string, serviceName string, version string) error
- func (m *Machine) WaitForStatefulSet(namespace string, name string) error
- func (m *Machine) WaitForStatefulSetDelete(namespace string, name string) error
- func (m *Machine) WaitForStatefulSetNewGeneration(namespace string, name string, currentVersion int64) error
- type QuarksCmds
- type QuarksJobCmd
- type QuarksSecretCmd
- type QuarksStatefulsetCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NukeWebhooks ¶
func NukeWebhooks(namespacesToNuke []string)
NukeWebhooks nukes all webhooks at the end of the run
func Teardown ¶
func Teardown(e *Environment, wasFailure bool)
Teardown removes the setup after each test
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 ¶
func (e *Environment) NodeIP() (string, error)
NodeIP returns a public IP of a node
func (*Environment) QStsPort ¶
func (e *Environment) QStsPort() int32
QStsPort returns the port for the quarks statefulset webhook service
func (*Environment) SetupClientsets ¶
func (e *Environment) SetupClientsets() error
SetupClientsets initializes kube clientsets
func (*Environment) SetupNamespace ¶
func (e *Environment) SetupNamespace() error
SetupNamespace creates the namespace and the clientsets and prepares the teardowm
func (*Environment) SetupPort ¶
func (e *Environment) SetupPort() error
SetupPort of the webhook server
func (*Environment) SetupQjobAccount ¶
func (e *Environment) SetupQjobAccount() error
SetupQjobAccount creates the role binding for the quarks job's persist output feature. For testing this is cluster-admin.
func (*Environment) SetupServiceAccount ¶
func (e *Environment) SetupServiceAccount() error
SetupServiceAccount creates a service account for coredns
func (*Environment) StartOperator ¶
func (e *Environment) StartOperator() error
StartOperator prepares and starts the quarks-operator
type Machine ¶
type Machine struct { machine.Machine VersionedClientset *versioned.Clientset QuarksStatefulSetClient *qstsclient.Clientset }
Machine produces and destroys resources for tests
func (*Machine) CollectDeployment ¶
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 ¶
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 ¶
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 ¶
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) CreateStatefulSet ¶
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 ¶
DeleteBOSHDeployment deletes a BOSHDeployment custom resource
func (*Machine) ExecPodCMD ¶
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 ¶
GetBOSHDeployment gets a BOSHDeployment custom resource
func (*Machine) GetInstanceGroupPods ¶
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 ¶
GetNamespaceEvents exits as soon as an event reason and msg matches
func (*Machine) GetStatefulSet ¶
GetStatefulSet gets a StatefulSet by namespace and name
func (*Machine) GetStatefulSetByInstanceGroup ¶
func (m *Machine) GetStatefulSetByInstanceGroup(namespace string, name string, versions []string) (*appsv1.StatefulSet, error)
GetStatefulSetByInstanceGroup gets a StatefulSet by namespace and an instance group name and version
func (*Machine) GetStatefulSetByInstanceGroupName ¶
func (m *Machine) GetStatefulSetByInstanceGroupName(namespace string, name string) (*appsv1.StatefulSet, error)
GetStatefulSetByInstanceGroupName gets a StatefulSet by namespace and an instance group name
func (*Machine) HasBOSHDeployment ¶
HasBOSHDeployment returns true if the pod by that name is in state running
func (*Machine) PVAvailable ¶
PVAvailable returns true if the pv by that name is in state available
func (*Machine) PVCsDeleted ¶
PVCsDeleted returns true if the all pvs are deleted
func (*Machine) PVsDeleted ¶
PVsDeleted returns true if the all pvs are deleted
func (*Machine) PatchPod ¶
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 ¶
PodLabelToExist returns true if the label exist in the specified pod
func (*Machine) PodLabelToNotExist ¶
PodLabelToNotExist returns true if the label does not exist
func (*Machine) QuarksStatefulSetExists ¶
QuarksStatefulSetExists returns true if at least one ess selected by labels exists
func (*Machine) StatefulSetExist ¶
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 ¶
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) WaitForBOSHDeploymentDeletion ¶
WaitForBOSHDeploymentDeletion blocks until the CR is deleted
func (*Machine) WaitForDeployment ¶
WaitForDeployment waits for deployment with generation > x to appear
func (*Machine) WaitForInstanceGroup ¶
func (m *Machine) WaitForInstanceGroup(namespace string, deployment string, igName string, count int) error
WaitForInstanceGroup blocks until all selected pods of the instance group are running. It fails after the timeout.
func (*Machine) WaitForInstanceGroupVersions ¶
func (m *Machine) WaitForInstanceGroupVersions(namespace string, deployment string, igName string, count int, versions ...string) error
WaitForInstanceGroupVersions blocks until the specified number of pods from the instance group version are running. It fails after the timeout.
func (*Machine) WaitForPVCsDelete ¶
WaitForPVCsDelete blocks until the pvc is deleted. It fails after the timeout.
func (*Machine) WaitForPVsDelete ¶
WaitForPVsDelete blocks until the pv is deleted. It fails after the timeout.
func (*Machine) WaitForPodLabelToExist ¶
WaitForPodLabelToExist blocks until the specified label appears
func (*Machine) WaitForPodLabelToNotExist ¶
WaitForPodLabelToNotExist blocks until the specified label is not present
func (*Machine) WaitForQuarksStatefulSetDelete ¶
WaitForQuarksStatefulSetDelete blocks until the specified quarksstatefulSet is deleted
func (*Machine) WaitForServiceVersion ¶
WaitForServiceVersion blocks until the service of the instance group is created/updated. It fails after the timeout.
func (*Machine) WaitForStatefulSet ¶
WaitForStatefulSet blocks until all statefulSet pods are running. It fails after the timeout.
func (*Machine) WaitForStatefulSetDelete ¶
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 QuarksCmds ¶
type QuarksCmds struct { Job QuarksJobCmd Secret QuarksSecretCmd Statefulset QuarksStatefulsetCmd }
QuarksCmds holds the quarks standalone components gexec binaries
func NewQuarksCmds ¶
func NewQuarksCmds() *QuarksCmds
NewQuarksCmds returns a new struct for the standalone commands
func (*QuarksCmds) Build ¶
func (q *QuarksCmds) Build() error
Build builds all the standalone binaries
func (*QuarksCmds) Marshal ¶
func (q *QuarksCmds) Marshal() []byte
Marshal returns a JSON with the paths to the binaries
func (*QuarksCmds) Unmarshal ¶
func (q *QuarksCmds) Unmarshal(data []byte) error
Unmarshal loads the binary paths from JSON
type QuarksJobCmd ¶
type QuarksJobCmd struct {
Path string
}
QuarksJobCmd helps to run the QuarksJob operator in tests
func (*QuarksJobCmd) Build ¶
func (q *QuarksJobCmd) Build() error
Build builds the quarks-job operator binary
func (*QuarksJobCmd) Start ¶
func (q *QuarksJobCmd) Start(id string) error
Start starts the specified quarks-job in a namespace
type QuarksSecretCmd ¶
type QuarksSecretCmd struct {
Path string
}
QuarksSecretCmd helps to run the QuarksSecret operator in tests
func (*QuarksSecretCmd) Build ¶
func (q *QuarksSecretCmd) Build() error
Build builds the quarks-secret operator binary
func (*QuarksSecretCmd) Start ¶
func (q *QuarksSecretCmd) Start(id string) error
Start starts the specified quarks-secret in a namespace
type QuarksStatefulsetCmd ¶
type QuarksStatefulsetCmd struct {
Path string
}
QuarksStatefulsetCmd helps to run the QuarksStatefulset operator in tests
func (*QuarksStatefulsetCmd) Build ¶
func (q *QuarksStatefulsetCmd) Build() error
Build builds the quarks-statefulset operator binary