Documentation
¶
Overview ¶
Package rollouts provides Terratest-style helpers for testing Argo Rollouts. It includes polling-based utilities for checking rollout phases, pause states, and progressive deployment status using the Argo Rollouts clientset.
Index ¶
- func ListRollouts(t *testing.T, options *k8s.KubectlOptions, namespace string) []rolloutsv1alpha1.Rollout
- func NewArgoRolloutsClient(t *testing.T, options *k8s.KubectlOptions) (rolloutClientSet.Interface, error)
- func WaitForRolloutHealthy(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForRolloutPaused(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListRollouts ¶ added in v0.0.5
func ListRollouts(t *testing.T, options *k8s.KubectlOptions, namespace string) []rolloutsv1alpha1.Rollout
ListRollouts retrieves all Argo Rollouts in the specified namespace using the provided kubectl options. It requires a testing context and will fail the test if the client cannot be created or the Rollouts cannot be listed.
Parameters:
- t: The testing context.
- options: The kubectl options to use for connecting to the cluster.
- namespace: The namespace from which to list the Rollouts.
Returns:
- A slice of rolloutsv1alpha1.Rollout objects representing the Rollouts in the given namespace.
func NewArgoRolloutsClient ¶ added in v0.0.5
func NewArgoRolloutsClient(t *testing.T, options *k8s.KubectlOptions) (rolloutClientSet.Interface, error)
NewArgoRolloutsClient creates a new Argo Rollouts client using the provided testing context and kubectl options. It retrieves the Kubernetes REST configuration from the given options or generates one if not present. Returns an Argo Rollouts client interface and an error if the client could not be created.
Parameters:
- t: The testing context, used for logging and error handling.
- options: The kubectl options containing cluster configuration and optional REST config.
Returns:
- rolloutClientSet.Interface: The Argo Rollouts client interface for interacting with Rollouts resources.
- error: An error if the client could not be created.
func WaitForRolloutHealthy ¶
func WaitForRolloutHealthy(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)
WaitForRolloutHealthy waits until the specified Argo Rollout resource reaches a Healthy phase within the given timeout. It polls the rollout status every 2 seconds and checks for the "Progressing" condition with status "True" and phase "Healthy". If the rollout does not become healthy within the timeout, the test fails. Parameters:
- t: The testing context.
- options: Kubectl options containing the REST config for the Kubernetes client.
- name: The name of the rollout resource.
- namespace: The namespace of the rollout resource.
- timeout: The maximum duration to wait for the rollout to become healthy.
func WaitForRolloutPaused ¶
func WaitForRolloutPaused(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)
WaitForRolloutPaused waits until the specified Argo Rollout resource enters the "Paused" phase within the given timeout. It polls the rollout status every 2 seconds using the provided Kubernetes options, rollout name, and namespace. If the rollout does not reach the paused phase within the timeout, the test fails with a fatal error. Requires a valid Argo Rollouts clientset and test context.
Parameters:
t - The testing context. options - The kubectl options containing REST config for the client. name - The name of the rollout resource. namespace- The namespace of the rollout resource. timeout - The maximum duration to wait for the rollout to pause.
Types ¶
This section is empty.