validate

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package validate contains code to check objects deployed by the operator as part of an E2E test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForObjectUpdates added in v1.0.0

func CheckForObjectUpdates(ctx context.Context, c *deploy.Cluster, metricsURL string, expectedUpdates []client.Object, deployment api.PmemCSIDeployment) error

CheckForObjectUpdates wait and checks for deployed driver components in consistent state. That means no unnecessary updates occurred and all expected object updates passed in expectedUpdates have occurred. It uses the 'pmem_csi_deployment_sub_resource_updated_at' metric.

Beware that this check only works if a test calling it uses a new deployment with a unique UID. Otherwise object updates from a previous test may get picked up.

When the CR just got created, the operator should immediately create objects with the right content and then not update them again unless it is an expected update from the caller.

func DriverDeployment

func DriverDeployment(ctx context.Context, c client.Client, k8sver version.Version, namespace string, deployment api.PmemCSIDeployment) error

DriverDeployment compares all objects as deployed by the operator against the expected objects for a certain deployment spec. deploymentSpec should only have those fields set which are not the defaults. The caller must ensure that the operator is done with creating objects.

A final error is returned when observing a problem that is not going to go away, like an unexpected update of an object.

func DriverDeploymentEventually

func DriverDeploymentEventually(ctx context.Context, c *deploy.Cluster, client client.Client, k8sver version.Version, metricsURL, namespace string, deployment api.PmemCSIDeployment, lastCount float64) (float64, error)

DriverDeployment compares all objects as deployed by the operator against the expected objects for a certain deployment spec. deploymentSpec should only have those fields set which are not the defaults. This call will wait for the expected objects until the context times out.

func WaitForDeploymentReconciled added in v1.0.0

func WaitForDeploymentReconciled(ctx context.Context, c *deploy.Cluster, metricsURL string, deployment api.PmemCSIDeployment, lastCount float64) (float64, error)

WaitForDeploymentReconciled waits and checks till the context timedout that if given deployment got reconciled by the operator. It checks in the operator metrics for a new 'pmem_csi_deployment_reconcile' metric count is greater that the lastCount. If found it returns the new reconcile count.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL