Documentation ¶
Index ¶
- Constants
- Variables
- func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error)
- func DeleteClusterRoleBinding(c kubernetes.Interface, name string) error
- func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error
- func ExpectNoError(err error, explain ...interface{})
- func Failf(format string, args ...interface{})
- func InstallReainbondOperator(operatorName, chartsPath, namespace string) error
- func Logf(format string, args ...interface{})
- func NewInt32(val int32) *int32
- func NewInt64(val int64) *int64
- func RestclientConfig(config, context string) (*api.Config, error)
- func Skipf(format string, args ...interface{})
- func WaitForFileInFS(file string) error
- func WaitForIngressInNamespace(c kubernetes.Interface, namespace, name string) error
- func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error
- func WaitForNoIngressInNamespace(c kubernetes.Interface, namespace, name string) error
- func WaitForNoPodsInNamespace(c kubernetes.Interface, namespace string) error
- func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *corev1.Pod) error
- func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration, ...) error
- func WaitForSecretInNamespace(c kubernetes.Interface, namespace, name string) error
- type Framework
Constants ¶
const ( // Poll how often to poll for conditions Poll = 3 * time.Second // DefaultTimeout time to wait for operations to complete DefaultTimeout = 3 * time.Minute )
Variables ¶
var RunID = uuid.NewUUID()
RunID unique identifier of the e2e run
Functions ¶
func CreateKubeNamespace ¶
func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error)
CreateKubeNamespace creates a new namespace in the cluster
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(c kubernetes.Interface, name string) error
DeleteClusterRoleBinding deletes a ClusterRoleBinding
func DeleteKubeNamespace ¶
func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error
DeleteKubeNamespace deletes a namespace and all the objects inside
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
ExpectNoError tests whether an error occurred.
func Failf ¶
func Failf(format string, args ...interface{})
Failf logs to the INFO logs and fails the test.
func RestclientConfig ¶
RestclientConfig deserializes the contents of a kubeconfig file into a Config object.
func Skipf ¶
func Skipf(format string, args ...interface{})
Skipf logs to the INFO logs and skips the test.
func WaitForFileInFS ¶
WaitForFileInFS waits a default amount of time for the specified file is present in the filesystem
func WaitForIngressInNamespace ¶
func WaitForIngressInNamespace(c kubernetes.Interface, namespace, name string) error
WaitForIngressInNamespace waits until a particular ingress object exists namespace
func WaitForKubeNamespaceNotExist ¶
func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error
WaitForKubeNamespaceNotExist waits until a namespaces is not present in the cluster
func WaitForNoIngressInNamespace ¶
func WaitForNoIngressInNamespace(c kubernetes.Interface, namespace, name string) error
WaitForNoIngressInNamespace waits until there is no ingress object in a particular namespace
func WaitForNoPodsInNamespace ¶
func WaitForNoPodsInNamespace(c kubernetes.Interface, namespace string) error
WaitForNoPodsInNamespace waits until there are no pods running in a namespace
func WaitForPodRunningInNamespace ¶
func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *corev1.Pod) error
WaitForPodRunningInNamespace waits a default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodsReady ¶
func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration, expectedReplicas int, namespace string, opts metav1.ListOptions) error
WaitForPodsReady waits for a given amount of time until a group of Pods is running in the given namespace.
func WaitForSecretInNamespace ¶
func WaitForSecretInNamespace(c kubernetes.Interface, namespace, name string) error
WaitForSecretInNamespace waits a default amount of time for the specified secret is present in a particular namespace
Types ¶
type Framework ¶
type Framework struct { BaseName string // A Kubernetes and Service Catalog client KubeClientSet kubernetes.Interface KubeConfig *restclient.Config RainbondClientset rainbondoperator.Interface Namespace string OperatorName string }
Framework supports common operations used by e2e tests; it will keep a kubernetes cluster for you.
func NewDefaultFramework ¶
NewDefaultFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) EnsureRainbondCluster ¶
func (f *Framework) EnsureRainbondCluster(new *rainbondv1alpha1.RainbondCluster) *rainbondv1alpha1.RainbondCluster
EnsureRainbondCluster creates a rainbondcluster object or returns it if it already exists.