Documentation ¶
Index ¶
- type ChanResult
- type Environment
- type Machine
- func (m *Machine) CheckExtendedStatefulSet(namespace string, name string, version int) error
- func (m *Machine) CheckExtendedStatefulSetVersion(namespace string, name string, version int) (bool, error)
- 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 bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, TearDownFunc, error)
- func (m *Machine) CreateBOSHDeploymentUsingChan(outputChannel chan ChanResult, namespace string, ...)
- 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) CreateNamespace(namespace string) (TearDownFunc, error)
- func (m *Machine) CreatePod(namespace string, pod corev1.Pod) (TearDownFunc, error)
- func (m *Machine) CreatePodWithTailLogsContainer(podName string, parentPodCmd string, parentCName string, sidecardCName string, ...) corev1.Pod
- 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) DeleteSecrets(namespace 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) (*bdv1.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) GetEndpoints(namespace string, name string) (*corev1.Endpoints, 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) GetInstanceGroupPods(namespace string, deployment string, igName string, version string) (*corev1.PodList, error)
- func (m *Machine) GetNodes() ([]corev1.Node, error)
- func (m *Machine) GetPod(namespace string, name string) (*corev1.Pod, error)
- func (m *Machine) GetPodContainerLogs(namespace, podName, containerName string) (string, 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) GetService(namespace string, name string) (*corev1.Service, 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) InitContainerRunning(namespace, podName, containerName 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) PodContainsLogMsg(namespace, podName, containerName, msg string) error
- func (m *Machine) PodCount(namespace string, labels string, match func(corev1.Pod) bool) (int, error)
- func (m *Machine) PodLabeled(namespace string, name string, desiredLabel, desiredValue string) (bool, error)
- func (m *Machine) PodReady(namespace string, name 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) StatefulSetExist(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) SubsetsExist(namespace string, endpointsName string) (bool, error)
- func (m *Machine) TearDownAll(funcs []TearDownFunc) error
- func (m *Machine) UpdateBOSHDeployment(namespace string, deployment bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, TearDownFunc, error)
- func (m *Machine) UpdateConfigMap(namespace string, configMap corev1.ConfigMap) (*corev1.ConfigMap, TearDownFunc, error)
- func (m *Machine) UpdateExtendedJob(namespace string, eJob 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) WaitForInitContainerRunning(namespace, podName, containerName string) error
- func (m *Machine) WaitForInstanceGroup(namespace string, deployment string, igName string, version string, count int) 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) WaitForPodContainerLogMatchRegexp(namespace string, podName string, containerName string, regExp string) error
- func (m *Machine) WaitForPodContainerLogMsg(namespace, podName, containerName, msg string) error
- func (m *Machine) WaitForPodFailures(namespace string, labels string) error
- func (m *Machine) WaitForPodLogMatchRegexp(namespace string, podName string, regExp string) error
- func (m *Machine) WaitForPodLogMsg(namespace string, podName string, msg string) error
- func (m *Machine) WaitForPodReady(namespace string, name 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) WaitForStatefulSetDelete(namespace string, name string) error
- func (m *Machine) WaitForStatefulSetNewGeneration(namespace string, name string, currentVersion int64) error
- func (m *Machine) WaitForSubsetsExist(namespace string, endpointsName string) error
- type StopFunc
- type TearDownFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanResult ¶ added in v0.3.1
type ChanResult struct {
Error error
}
ChanResult holds different fields that can be sent through a channel
type Environment ¶
type Environment struct { Machine testing.Catalog ID int Teardown func(wasFailure bool) 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 SetupNamespace ¶ added in v0.3.0
func SetupNamespace() *Environment
SetupNamespace creates a namespace that's meant to be used for one test, and then destroyed
func (*Environment) AllLogMessages ¶
func (e *Environment) AllLogMessages() (msgs []string)
AllLogMessages returns only the message part of existing logs to aid in debugging
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) CheckExtendedStatefulSet ¶ added in v0.2.2
CheckExtendedStatefulSet checks extendedstatefulset according to the version
func (*Machine) CheckExtendedStatefulSetVersion ¶ added in v0.2.2
func (m *Machine) CheckExtendedStatefulSetVersion(namespace string, name string, version int) (bool, error)
CheckExtendedStatefulSetVersion returns true if the version status is true
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 bdv1.BOSHDeployment) (*bdv1.BOSHDeployment, 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 ChanResult, namespace string, deployment bdv1.BOSHDeployment)
CreateBOSHDeploymentUsingChan creates a BOSHDeployment custom resource and returns an error via a channel
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) CreateNamespace ¶ added in v0.2.2
func (m *Machine) CreateNamespace(namespace string) (TearDownFunc, error)
CreateNamespace creates a namespace, it doesn't return an error if the namespace exists
func (*Machine) CreatePod ¶
CreatePod creates a default pod 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) 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) DeleteSecrets ¶ added in v0.3.0
DeleteSecrets deletes all the secrets
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) GetEndpoints ¶ added in v0.2.1
GetEndpoints gets target Endpoints
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) GetInstanceGroupPods ¶ added in v0.3.0
func (m *Machine) GetInstanceGroupPods(namespace string, deployment string, igName string, version string) (*corev1.PodList, error)
GetInstanceGroupPods returns all pods from a specific instance group version
func (*Machine) GetNodes ¶ added in v0.3.1
GetNodes gets nodes
func (*Machine) GetPod ¶
GetPod returns pod by name
func (*Machine) GetPodContainerLogs ¶ added in v0.3.0
GetPodContainerLogs gets logs for a specific container in a pd
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) GetService ¶ added in v0.2.0
GetService gets target Service
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) InitContainerRunning ¶ added in v0.3.1
InitContainerRunning returns true if the pod by that name has a specific init container that 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) PodContainsLogMsg ¶ added in v0.4.0
PodContainsLogMsg searches pod test logs for at least one occurrence of msg, but it will have a shorter timeout(10secs). This is for tests where one does not expect to see a log.
func (*Machine) PodCount ¶ added in v0.3.0
func (m *Machine) PodCount(namespace string, labels string, match func(corev1.Pod) bool) (int, error)
PodCount returns the number of matching pods
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) PodReady ¶ added in v0.4.0
PodReady returns true if the pod by that name is ready.
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 secret by that name exist
func (*Machine) StatefulSetExist ¶ added in v0.2.1
StatefulSetExist checks if the statefulset exists
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) SubsetsExist ¶ added in v0.2.1
SubsetsExist checks if the subsets of the endpoints exist
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 bdv1.BOSHDeployment) (*bdv1.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, eJob 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 updates 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) WaitForInitContainerRunning ¶ added in v0.3.1
WaitForInitContainerRunning blocks until a pod's init container is running. It fails after the timeout.
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) 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) WaitForPodContainerLogMatchRegexp ¶ added in v0.3.1
func (m *Machine) WaitForPodContainerLogMatchRegexp(namespace string, podName string, containerName string, regExp string) error
WaitForPodContainerLogMatchRegexp searches a pod's container test logs for at least one occurrence of Regexp.
func (*Machine) WaitForPodContainerLogMsg ¶ added in v0.3.0
WaitForPodContainerLogMsg searches pod test logs for at least one occurrence of msg.
func (*Machine) WaitForPodFailures ¶
WaitForPodFailures blocks until all selected pods are failing. It fails after the timeout.
func (*Machine) WaitForPodLogMatchRegexp ¶ added in v0.2.1
WaitForPodLogMatchRegexp searches pod test logs for at least one occurrence of Regexp.
func (*Machine) WaitForPodLogMsg ¶ added in v0.2.1
WaitForPodLogMsg searches pod test logs for at least one occurrence of msg.
func (*Machine) WaitForPodReady ¶ added in v0.4.0
WaitForPodReady blocks until the pod is ready. 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.
func (*Machine) WaitForStatefulSetDelete ¶ added in v0.2.1
WaitForStatefulSetDelete blocks until the specified statefulset is deleted