Documentation ¶
Index ¶
- Variables
- func CheckPodsRunningReady(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ...) bool
- func GetClients() (ctrlruntimeclient.Client, rest.Interface, *rest.Config, error)
- func GetClientsOrDie() (ctrlruntimeclient.Client, rest.Interface, *rest.Config)
- func KubernetesVersion() string
- func PodRunningReady(p *corev1.Pod) error
- func WaitFor(interval time.Duration, timeout time.Duration, callback func() bool) bool
- func WaitForDeploymentReady(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ...) error
- func WaitForPodCondition(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ...) error
- func WaitForPodsCreated(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ...) ([]string, error)
- type TestPodConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultLogOptions = log.Options{ Debug: false, Format: log.FormatConsole, }
Functions ¶
func CheckPodsRunningReady ¶ added in v2.17.0
func CheckPodsRunningReady(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ns string, podNames []string, timeout time.Duration) bool
CheckPodsRunningReady returns whether all pods whose names are listed in podNames in namespace ns are running and ready, using c and waiting at most timeout.
func GetClients ¶ added in v2.17.0
GetClients returns the clients used for testing or an error if something goes wrong during the clients creation.
func GetClientsOrDie ¶ added in v2.17.0
GetClientsOrDie returns the clients used for testing or panics if something goes wrong during the clients creation.
func KubernetesVersion ¶
func KubernetesVersion() string
func PodRunningReady ¶ added in v2.17.0
PodRunningReady checks whether pod p's phase is running and it has a ready condition of status true.
func WaitFor ¶
WaitFor is a convenience wrapper that makes simple, "brute force" waiting loops easier to write.
func WaitForDeploymentReady ¶ added in v2.21.0
func WaitForDeploymentReady(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ns, name string, timeout time.Duration) error
WaitForDeploymentReady waits until the Deployment is fully ready.
func WaitForPodCondition ¶ added in v2.17.0
func WaitForPodCondition(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, ns, podName, desc string, timeout time.Duration, condition podCondition) error
WaitForPodCondition waits a pods to be matched to the given condition.
func WaitForPodsCreated ¶ added in v2.17.0
func WaitForPodsCreated(ctx context.Context, c ctrlruntimeclient.Client, log *zap.SugaredLogger, replicas int, namespace string, matchLabels map[string]string) ([]string, error)
WaitForPodsCreated waits for the given replicas number of pods matching the given set of labels to be created, and returns the names of the matched pods.
Types ¶
type TestPodConfig ¶ added in v2.17.0
type TestPodConfig struct { Log *zap.SugaredLogger Namespace string Client ctrlruntimeclient.Client PodRestClient rest.Interface Config *rest.Config // CreatePodFunc returns the manifest of the pod to be used for running the // test. As we need to exec the pod should not terminate (e.g. run an // infinite sleep). CreatePodFunc func(ns string) *corev1.Pod PodReadinessTimeout time.Duration // contains filtered or unexported fields }
func (*TestPodConfig) CleanUp ¶ added in v2.17.0
func (t *TestPodConfig) CleanUp(ctx context.Context) error
CleanUp deletes the resources.
func (*TestPodConfig) DeployTestPod ¶ added in v2.17.0
func (t *TestPodConfig) DeployTestPod(ctx context.Context, log *zap.SugaredLogger) error
DeployTestPod deploys the pod to be used to run the test command.