Documentation ¶
Index ¶
- type Environment
- type Machine
- func (m *Machine) CollectJobs(namespace string, labels string, n int) ([]batchv1.Job, error)
- func (m *Machine) CollectSecret(namespace string, name string) (*corev1.Secret, error)
- func (m *Machine) ContainExpectedEvent(events []corev1.Event, reason string, message string) bool
- func (m *Machine) ContainJob(jobs []batchv1.Job, name string) bool
- func (m *Machine) CreateBOSHDeployment(namespace string, deployment bdcv1.BOSHDeployment) (*bdcv1.BOSHDeployment, TearDownFunc, error)
- func (m *Machine) CreateConfigMap(namespace string, configMap corev1.ConfigMap) (TearDownFunc, error)
- func (m *Machine) CreateExtendedJob(namespace string, job ejv1.ExtendedJob) (*ejv1.ExtendedJob, TearDownFunc, error)
- func (m *Machine) CreateExtendedSecret(namespace string, es esv1.ExtendedSecret) (*esv1.ExtendedSecret, TearDownFunc, error)
- func (m *Machine) CreateExtendedStatefulSet(namespace string, ess essv1.ExtendedStatefulSet) (*essv1.ExtendedStatefulSet, TearDownFunc, error)
- func (m *Machine) CreatePod(namespace string, pod corev1.Pod) (TearDownFunc, error)
- func (m *Machine) CreateSecret(namespace string, secret corev1.Secret) (TearDownFunc, error)
- func (m *Machine) DeleteBOSHDeployment(namespace string, name string) error
- func (m *Machine) DeleteExtendedSecret(namespace string, name string) error
- func (m *Machine) DeleteExtendedStatefulSet(namespace string, name string) error
- func (m *Machine) DeleteJobs(namespace string, labels string) (bool, error)
- func (m *Machine) ExtendedJobExists(namespace string, name string) (bool, error)
- func (m *Machine) ExtendedStatefulSetAvailable(namespace string, name string, version int) (bool, error)
- func (m *Machine) ExtendedStatefulSetExists(namespace string, labels string) (bool, error)
- func (m *Machine) GetBOSHDeployment(namespace string, name string) (*bdcv1.BOSHDeployment, error)
- func (m *Machine) GetBOSHDeploymentEvents(namespace string, name string, id string) ([]corev1.Event, error)
- func (m *Machine) GetConfigMap(namespace string, name string) (*corev1.ConfigMap, error)
- func (m *Machine) GetExtendedJob(namespace string, name string) (*ejv1.ExtendedJob, error)
- func (m *Machine) GetExtendedStatefulSet(namespace string, name string) (*essv1.ExtendedStatefulSet, error)
- func (m *Machine) GetPod(namespace string, name string) (*corev1.Pod, error)
- func (m *Machine) GetPodLogs(namespace, podName string) (string, error)
- func (m *Machine) GetPods(namespace string, labels string) (*corev1.PodList, error)
- func (m *Machine) GetSecret(namespace string, name string) (*corev1.Secret, error)
- func (m *Machine) GetStatefulSet(namespace string, name string) (*v1beta1.StatefulSet, error)
- func (m *Machine) HasBOSHDeployment(namespace string, name string) (bool, error)
- func (m *Machine) HasBOSHDeploymentEvent(namespace string, fieldSelector string) (bool, error)
- func (m *Machine) JobExists(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) PodLabeled(namespace string, name string, desiredLabel, desiredValue string) (bool, error)
- func (m *Machine) PodRunning(namespace string, name string) (bool, error)
- func (m *Machine) PodsDeleted(namespace string) (bool, error)
- func (m *Machine) PodsFailing(namespace string, labels string) (bool, error)
- func (m *Machine) PodsRunning(namespace string, labels string) (bool, error)
- func (m *Machine) SecretExists(namespace string, name string) (bool, error)
- func (m *Machine) StatefulSetNewGeneration(namespace string, name string, version int64) (bool, error)
- func (m *Machine) StatefulSetRunning(namespace string, name string) (bool, error)
- func (m *Machine) TearDownAll(funcs []TearDownFunc) error
- func (m *Machine) UpdateBOSHDeployment(namespace string, deployment bdcv1.BOSHDeployment) (*bdcv1.BOSHDeployment, TearDownFunc, error)
- func (m *Machine) UpdateConfigMap(namespace string, configMap corev1.ConfigMap) (*corev1.ConfigMap, TearDownFunc, error)
- func (m *Machine) UpdateExtendedJob(namespace string, exJob ejv1.ExtendedJob) error
- func (m *Machine) UpdateExtendedStatefulSet(namespace string, ess essv1.ExtendedStatefulSet) (*essv1.ExtendedStatefulSet, TearDownFunc, error)
- func (m *Machine) UpdateSecret(namespace string, secret corev1.Secret) (*corev1.Secret, TearDownFunc, error)
- func (m *Machine) WaitForBOSHDeploymentDeletion(namespace string, name string) error
- func (m *Machine) WaitForBOSHDeploymentEvent(namespace string, fieldSelector string) error
- func (m *Machine) WaitForExtendedJobDeletion(namespace string, name string) error
- func (m *Machine) WaitForExtendedStatefulSetAvailable(namespace string, name string, version int) error
- func (m *Machine) WaitForExtendedStatefulSets(namespace string, labels string) error
- func (m *Machine) WaitForJobDeletion(namespace string, name string) error
- func (m *Machine) WaitForJobExists(namespace string, labels string) (bool, error)
- func (m *Machine) WaitForJobsDeleted(namespace string, labels string) error
- func (m *Machine) WaitForLogMsg(logs *observer.ObservedLogs, msg string) 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) WaitForPod(namespace string, name string) error
- func (m *Machine) WaitForPodFailures(namespace string, labels string) error
- func (m *Machine) WaitForPods(namespace string, labels string) error
- func (m *Machine) WaitForPodsDelete(namespace string) error
- func (m *Machine) WaitForSecret(namespace string, name string) error
- func (m *Machine) WaitForSecretDeletion(namespace string, name string) error
- func (m *Machine) WaitForStatefulSet(namespace string, labels string) error
- func (m *Machine) WaitForStatefulSetNewGeneration(namespace string, name string, currentVersion int64) error
- type StopFunc
- type TearDownFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct { Machine testing.Catalog Log *zap.SugaredLogger Config *config.Config ObservedLogs *observer.ObservedLogs Namespace string // contains filtered or unexported fields }
Environment starts our operator and handles interaction with the k8s cluster used in the tests
func (*Environment) AllLogMessages ¶
func (e *Environment) AllLogMessages() (msgs []string)
AllLogMessages returns only the message part of existing logs to aid in debugging
func (*Environment) Setup ¶
func (e *Environment) Setup() (StopFunc, error)
Setup prepares the test environment by loading config and finally starting the operator
type Machine ¶
type Machine struct { Clientset *kubernetes.Clientset VersionedClientset *versioned.Clientset // contains filtered or unexported fields }
Machine produces and destroys resources for tests
func (*Machine) CollectJobs ¶
CollectJobs waits for n jobs with specified labels. It fails after the timeout.
func (*Machine) CollectSecret ¶
CollectSecret polls untile the specified secret can be fetched
func (*Machine) ContainExpectedEvent ¶
ContainExpectedEvent return true if events contain target resource event
func (*Machine) ContainJob ¶
ContainJob searches job array for a job matching `name`
func (*Machine) CreateBOSHDeployment ¶
func (m *Machine) CreateBOSHDeployment(namespace string, deployment bdcv1.BOSHDeployment) (*bdcv1.BOSHDeployment, TearDownFunc, error)
CreateBOSHDeployment creates a BOSHDeployment custom resource and returns a function to delete it
func (*Machine) CreateConfigMap ¶
func (m *Machine) CreateConfigMap(namespace string, configMap corev1.ConfigMap) (TearDownFunc, error)
CreateConfigMap creates a ConfigMap and returns a function to delete it
func (*Machine) CreateExtendedJob ¶
func (m *Machine) CreateExtendedJob(namespace string, job ejv1.ExtendedJob) (*ejv1.ExtendedJob, TearDownFunc, error)
CreateExtendedJob creates an ExtendedJob
func (*Machine) CreateExtendedSecret ¶
func (m *Machine) CreateExtendedSecret(namespace string, es esv1.ExtendedSecret) (*esv1.ExtendedSecret, TearDownFunc, error)
CreateExtendedSecret creates a ExtendedSecret custom resource and returns a function to delete it
func (*Machine) CreateExtendedStatefulSet ¶
func (m *Machine) CreateExtendedStatefulSet(namespace string, ess essv1.ExtendedStatefulSet) (*essv1.ExtendedStatefulSet, TearDownFunc, error)
CreateExtendedStatefulSet creates a ExtendedStatefulSet custom resource and returns a function to delete it
func (*Machine) CreatePod ¶
CreatePod creates a default pod and returns a function to delete it
func (*Machine) CreateSecret ¶
CreateSecret creates a secret and returns a function to delete it
func (*Machine) DeleteBOSHDeployment ¶
DeleteBOSHDeployment deletes a BOSHDeployment custom resource
func (*Machine) DeleteExtendedSecret ¶
DeleteExtendedSecret deletes an ExtendedSecret custom resource
func (*Machine) DeleteExtendedStatefulSet ¶
DeleteExtendedStatefulSet deletes a ExtendedStatefulSet custom resource
func (*Machine) DeleteJobs ¶
DeleteJobs deletes all the jobs
func (*Machine) ExtendedJobExists ¶
ExtendedJobExists returns true if extended job with that name exists
func (*Machine) ExtendedStatefulSetAvailable ¶
func (m *Machine) ExtendedStatefulSetAvailable(namespace string, name string, version int) (bool, error)
ExtendedStatefulSetAvailable returns true if current version is available
func (*Machine) ExtendedStatefulSetExists ¶
ExtendedStatefulSetExists returns true if at least one ess selected by labels exists
func (*Machine) GetBOSHDeployment ¶
GetBOSHDeployment gets a BOSHDeployment custom resource
func (*Machine) GetBOSHDeploymentEvents ¶
func (m *Machine) GetBOSHDeploymentEvents(namespace string, name string, id string) ([]corev1.Event, error)
GetBOSHDeploymentEvents gets target resource events
func (*Machine) GetConfigMap ¶
GetConfigMap gets a ConfigMap by name
func (*Machine) GetExtendedJob ¶
GetExtendedJob gets an ExtendedJob custom resource
func (*Machine) GetExtendedStatefulSet ¶
func (m *Machine) GetExtendedStatefulSet(namespace string, name string) (*essv1.ExtendedStatefulSet, error)
GetExtendedStatefulSet gets a ExtendedStatefulSet custom resource
func (*Machine) GetPod ¶
GetPod returns pod by name
func (*Machine) GetPodLogs ¶
GetPodLogs gets pod logs
func (*Machine) GetPods ¶
GetPods returns all the pods selected by labels
func (*Machine) GetSecret ¶
GetSecret fetches the specified secret
func (*Machine) GetStatefulSet ¶
GetStatefulSet gets a StatefulSet custom resource
func (*Machine) HasBOSHDeployment ¶
HasBOSHDeployment returns true if the pod by that name is in state running
func (*Machine) HasBOSHDeploymentEvent ¶
HasBOSHDeploymentEvent returns true if the pod by that name is in state running
func (*Machine) JobExists ¶
JobExists returns true if job with that name exists
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) PodLabeled ¶
func (m *Machine) PodLabeled(namespace string, name string, desiredLabel, desiredValue string) (bool, error)
PodLabeled returns true if the pod is labeled correctly
func (*Machine) PodRunning ¶
PodRunning returns true if the pod by that name is in state running
func (*Machine) PodsDeleted ¶
PodsDeleted returns true if the all pods are deleted
func (*Machine) PodsFailing ¶
PodsFailing returns true if the pod by that name exist and is in a failed state
func (*Machine) PodsRunning ¶
PodsRunning returns true if all the pods selected by labels are in state running Note that only the first page of pods is considered - don't use this if you have a long pod list that you care about
func (*Machine) SecretExists ¶
SecretExists returns true if the pod by that name is in state running
func (*Machine) StatefulSetNewGeneration ¶
func (m *Machine) StatefulSetNewGeneration(namespace string, name string, version int64) (bool, error)
StatefulSetNewGeneration returns true if StatefulSet has new generation
func (*Machine) StatefulSetRunning ¶
StatefulSetRunning returns true if the statefulset by that name has all pods created
func (*Machine) TearDownAll ¶
func (m *Machine) TearDownAll(funcs []TearDownFunc) error
TearDownAll calls all passed in tear down functions in order
func (*Machine) UpdateBOSHDeployment ¶
func (m *Machine) UpdateBOSHDeployment(namespace string, deployment bdcv1.BOSHDeployment) (*bdcv1.BOSHDeployment, TearDownFunc, error)
UpdateBOSHDeployment creates a BOSHDeployment custom resource and returns a function to delete it
func (*Machine) UpdateConfigMap ¶
func (m *Machine) UpdateConfigMap(namespace string, configMap corev1.ConfigMap) (*corev1.ConfigMap, TearDownFunc, error)
UpdateConfigMap updates a ConfigMap and returns a function to delete it
func (*Machine) UpdateExtendedJob ¶
func (m *Machine) UpdateExtendedJob(namespace string, exJob ejv1.ExtendedJob) error
UpdateExtendedJob updates an extended job
func (*Machine) UpdateExtendedStatefulSet ¶
func (m *Machine) UpdateExtendedStatefulSet(namespace string, ess essv1.ExtendedStatefulSet) (*essv1.ExtendedStatefulSet, TearDownFunc, error)
UpdateExtendedStatefulSet creates a ExtendedStatefulSet custom resource and returns a function to delete it
func (*Machine) UpdateSecret ¶
func (m *Machine) UpdateSecret(namespace string, secret corev1.Secret) (*corev1.Secret, TearDownFunc, error)
UpdateSecret updates a secret and returns a function to delete it
func (*Machine) WaitForBOSHDeploymentDeletion ¶
WaitForBOSHDeploymentDeletion blocks until the CR is deleted
func (*Machine) WaitForBOSHDeploymentEvent ¶
WaitForBOSHDeploymentEvent gets desired event
func (*Machine) WaitForExtendedJobDeletion ¶
WaitForExtendedJobDeletion blocks until the CR job is deleted
func (*Machine) WaitForExtendedStatefulSetAvailable ¶
func (m *Machine) WaitForExtendedStatefulSetAvailable(namespace string, name string, version int) error
WaitForExtendedStatefulSetAvailable blocks until latest version is available. It fails after the timeout.
func (*Machine) WaitForExtendedStatefulSets ¶
WaitForExtendedStatefulSets blocks until at least one ExtendedStatefulSet is found. It fails after the timeout.
func (*Machine) WaitForJobDeletion ¶
WaitForJobDeletion blocks until the batchv1.Job is deleted
func (*Machine) WaitForJobExists ¶
WaitForJobExists polls until a short timeout is reached or a job is found It returns true only if a job is found
func (*Machine) WaitForJobsDeleted ¶
WaitForJobsDeleted waits until the jobs no longer exists
func (*Machine) WaitForLogMsg ¶
func (m *Machine) WaitForLogMsg(logs *observer.ObservedLogs, msg string) error
WaitForLogMsg searches zap test logs for at least one occurrence of msg. When using this, tests should use FlushLog() to remove log messages from other tests.
func (*Machine) WaitForPV ¶
WaitForPV blocks until the pv is 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) WaitForPod ¶
WaitForPod blocks until the pod is running. It fails after the timeout.
func (*Machine) WaitForPodFailures ¶
WaitForPodFailures blocks until all selected pods are failing. It fails after the timeout.
func (*Machine) WaitForPods ¶
WaitForPods blocks until all selected pods are running. It fails after the timeout.
func (*Machine) WaitForPodsDelete ¶
WaitForPodsDelete blocks until the pod is deleted. It fails after the timeout.
func (*Machine) WaitForSecret ¶
WaitForSecret blocks until the secret is available. It fails after the timeout.
func (*Machine) WaitForSecretDeletion ¶
WaitForSecretDeletion blocks until the CR is deleted
func (*Machine) WaitForStatefulSet ¶
WaitForStatefulSet blocks until all statefulset pods are running. It fails after the timeout.