Documentation ¶
Overview ¶
Package e2e contains tests that validate the behavior of gmp-operator against a cluster. To make tests simple and fast, the test suite runs the operator internally. The CRDs are expected to be installed out of band (along with the operator deployment itself in a real world setup).
Index ¶
- func Debug(ctx context.Context, restConfig *rest.Config, kubeClient client.Client, ...) error
- func DeploymentComplete(deployment *appsv1.Deployment, newStatus *appsv1.DeploymentStatus) bool
- func DeploymentContainer(deployment *appsv1.Deployment, name string) (*corev1.Container, error)
- func DeploymentPods(ctx context.Context, kubeClient client.Client, namespace, name string) ([]corev1.Pod, error)
- func Events(ctx context.Context, kubeClient client.Client, gvk schema.GroupVersionKind, ...) ([]string, error)
- func PodLogs(ctx context.Context, restConfig *rest.Config, ...) (string, error)
- func PortForwardClient(restConfig *rest.Config, kubeClient client.Client, out, errOut io.Writer) (*http.Client, error)
- func ResourceFromYAML(scheme *runtime.Scheme, b []byte) (client.Object, error)
- func ResourcesFromYAML(scheme *runtime.Scheme, b []byte) ([]client.Object, error)
- func WaitForDeploymentReady(ctx context.Context, kubeClient client.Client, namespace, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(ctx context.Context, restConfig *rest.Config, kubeClient client.Client, o client.Object, out io.Writer) error
Debug prints both events and logs of the given resource. Consider passing a new context here in case the original context is cancelled.
func DeploymentComplete ¶
func DeploymentComplete(deployment *appsv1.Deployment, newStatus *appsv1.DeploymentStatus) bool
Copied from https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/util/deployment_util.go DeploymentComplete considers a deployment to be complete once all of its desired replicas are updated and available, and no old pods are running.
func DeploymentContainer ¶
func DeploymentPods ¶
func DeploymentPods(ctx context.Context, kubeClient client.Client, namespace, name string) ([]corev1.Pod, error)
DeploymentPods returns the pods used for the given Deployment.
func Events ¶
func Events(ctx context.Context, kubeClient client.Client, gvk schema.GroupVersionKind, namespace, name string) ([]string, error)
Events returns the events of the given resource.
func PodLogs ¶
func PodLogs(ctx context.Context, restConfig *rest.Config, namespace, name, container string) (string, error)
PodLogs returns the logs of the pod with the given name.
func PortForwardClient ¶
func PortForwardClient(restConfig *rest.Config, kubeClient client.Client, out, errOut io.Writer) (*http.Client, error)
PortForwardClient returns a client that ports-forward all Kubernetes-local HTTP requests to the host.
func ResourceFromYAML ¶
func ResourcesFromYAML ¶
Types ¶
This section is empty.