steps

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeSuite

func BeforeSuite()

func BundleInstalled

func BundleInstalled(ctx context.Context, name, version string) error

BundleInstalled waits for the ClusterExtension to report the specified bundle name and version as installed. Polls with timeout.

func CatalogIsDeleted

func CatalogIsDeleted(ctx context.Context, catalogName string) error

CatalogIsDeleted deletes the named ClusterCatalog resource and waits for it to be removed.

func CatalogIsUpdatedToVersion

func CatalogIsUpdatedToVersion(name, version string) error

CatalogIsUpdatedToVersion patches the ClusterCatalog's image reference to the specified version tag.

func CatalogServesBundles

func CatalogServesBundles(ctx context.Context, catalogName string) error

CatalogServesBundles applies the ClusterCatalog YAML template to create a catalog that serves bundles.

func CheckFeatureTags

func CheckFeatureTags(ctx context.Context, sc *godog.Scenario) (context.Context, error)

func ClusterExtensionIsAvailable

func ClusterExtensionIsAvailable(ctx context.Context) error

ClusterExtensionIsAvailable waits for the ClusterExtension's Installed condition to be True. Polls with timeout.

func ClusterExtensionIsRemoved

func ClusterExtensionIsRemoved(ctx context.Context) error

ClusterExtensionIsRemoved deletes the current ClusterExtension, saving its state for potential restore checks.

func ClusterExtensionIsRolledOut

func ClusterExtensionIsRolledOut(ctx context.Context) error

ClusterExtensionIsRolledOut waits for the ClusterExtension's Progressing condition to be True with reason Succeeded, then gathers its constituent resources into the scenario context. Polls with timeout.

func ClusterExtensionReconciledLatestGeneration

func ClusterExtensionReconciledLatestGeneration(ctx context.Context) error

ClusterExtensionReconciledLatestGeneration waits for the ClusterExtension's observedGeneration to match its metadata generation. Polls with timeout.

func ClusterExtensionReportsActiveRevisions

func ClusterExtensionReportsActiveRevisions(ctx context.Context, rawRevisionNames string) error

ClusterExtensionReportsActiveRevisions waits for the ClusterExtension's active revisions to match the expected set of revision names. Polls with timeout.

func ClusterExtensionReportsCondition

func ClusterExtensionReportsCondition(ctx context.Context, conditionType, conditionStatus, conditionReason string, msg *godog.DocString) error

ClusterExtensionReportsCondition waits for the ClusterExtension to have a condition matching the specified type, status, reason, and exact message. Polls with timeout.

func ClusterExtensionReportsConditionTransitionTime

func ClusterExtensionReportsConditionTransitionTime(ctx context.Context, conditionType string, minMinutes, maxMinutes int) error

ClusterExtensionReportsConditionTransitionTime asserts that a condition's lastTransitionTime falls within the specified minute range since the ClusterExtension's creation.

func ClusterExtensionReportsConditionWithMessageFragment

func ClusterExtensionReportsConditionWithMessageFragment(ctx context.Context, conditionType, conditionStatus, conditionReason string, msgFragment *godog.DocString) error

ClusterExtensionReportsConditionWithMessageFragment waits for the ClusterExtension to have a condition matching type, status, and reason, with a message containing the specified fragment. Polls with timeout.

func ClusterExtensionReportsConditionWithoutMsg

func ClusterExtensionReportsConditionWithoutMsg(ctx context.Context, conditionType, conditionStatus, conditionReason string) error

ClusterExtensionReportsConditionWithoutMsg waits for the ClusterExtension to have a condition matching type, status, and reason, without checking the message. Polls with timeout.

func ClusterExtensionReportsConditionWithoutReason

func ClusterExtensionReportsConditionWithoutReason(ctx context.Context, conditionType, conditionStatus string) error

ClusterExtensionReportsConditionWithoutReason waits for the ClusterExtension to have a condition matching type and status, without checking reason or message. Polls with timeout.

func ClusterExtensionResourcesCreatedAndAreLabeled

func ClusterExtensionResourcesCreatedAndAreLabeled(ctx context.Context) error

ClusterExtensionResourcesCreatedAndAreLabeled verifies each constituent resource has the expected OLM owner-kind and owner-name labels. Polls with timeout per resource.

func ClusterExtensionResourcesRemoved

func ClusterExtensionResourcesRemoved(ctx context.Context) error

ClusterExtensionResourcesRemoved waits for each previously gathered constituent resource to be deleted. Polls with timeout per resource.

func ClusterExtensionRevisionHasAnnotationWithValue

func ClusterExtensionRevisionHasAnnotationWithValue(ctx context.Context, revisionName, annotationKey string, annotationValue *godog.DocString) error

ClusterExtensionRevisionHasAnnotationWithValue waits for the named ClusterExtensionRevision to have the specified annotation with the expected value. Polls with timeout.

func ClusterExtensionRevisionHasLabelWithValue

func ClusterExtensionRevisionHasLabelWithValue(ctx context.Context, revisionName, labelKey, labelValue string) error

ClusterExtensionRevisionHasLabelWithValue waits for the named ClusterExtensionRevision to have the specified label with the expected value. Polls with timeout.

func ClusterExtensionRevisionIsArchived

func ClusterExtensionRevisionIsArchived(ctx context.Context, revisionName string) error

ClusterExtensionRevisionIsArchived waits for the named ClusterExtensionRevision to have Progressing=False with reason Archived. Polls with timeout.

func ClusterExtensionRevisionReportsConditionWithoutMsg

func ClusterExtensionRevisionReportsConditionWithoutMsg(ctx context.Context, revisionName, conditionType, conditionStatus, conditionReason string) error

ClusterExtensionRevisionReportsConditionWithoutMsg waits for the named ClusterExtensionRevision to have a condition matching type, status, and reason. Polls with timeout.

func ClusterExtensionVersionUpdate

func ClusterExtensionVersionUpdate(ctx context.Context, version string) error

ClusterExtensionVersionUpdate patches the ClusterExtension's catalog version to the specified value.

func CreateScenarioContext

func CreateScenarioContext(ctx context.Context, sc *godog.Scenario) (context.Context, error)

func MarkTestOperatorNotReady

func MarkTestOperatorNotReady(ctx context.Context, state string) error

MarkTestOperatorNotReady controls the test-operator's readiness probe by removing or creating the readiness file in its pod.

func OLMisAvailable

func OLMisAvailable(ctx context.Context) error

OLMisAvailable waits for the OLM operator-controller deployment to become available. Polls with timeout.

func OperatorTargetNamespace

func OperatorTargetNamespace(ctx context.Context, operator, namespace string) error

OperatorTargetNamespace asserts that the operator deployment has the expected olm.targetNamespaces annotation.

func PrometheusMetricsAreReturned

func PrometheusMetricsAreReturned(ctx context.Context) error

PrometheusMetricsAreReturned validates that each pod's stored metrics response is non-empty and parses as valid Prometheus text format.

func RegisterHooks

func RegisterHooks(sc *godog.ScenarioContext)

func RegisterSteps

func RegisterSteps(sc *godog.ScenarioContext)

func ResourceApplyFails

func ResourceApplyFails(ctx context.Context, errMsg string, yamlTemplate *godog.DocString) error

ResourceApplyFails waits for kubectl apply of the provided YAML to fail with the expected error message. Polls with timeout.

func ResourceAvailable

func ResourceAvailable(ctx context.Context, resource string) error

ResourceAvailable waits for the specified resource (kind/name format) to exist in the test namespace. Polls with timeout.

func ResourceEventuallyNotFound

func ResourceEventuallyNotFound(ctx context.Context, resource string) error

ResourceEventuallyNotFound waits for the specified resource to be fully deleted from the test namespace. Polls with timeout.

func ResourceIsApplied

func ResourceIsApplied(ctx context.Context, yamlTemplate *godog.DocString) error

ResourceIsApplied applies the provided YAML resource to the cluster and in case of ClusterExtension it captures its name in the test context so that it can be referred to in later steps with ${NAME}

func ResourceMatches

func ResourceMatches(ctx context.Context, resource string, requiredContentTemplate *godog.DocString) error

ResourceMatches waits for the specified resource to match the expected content using JSON merge patch comparison. Polls with timeout.

func ResourceRemoved

func ResourceRemoved(ctx context.Context, resource string) error

ResourceRemoved saves the resource state for potential restore checks, then deletes it from the test namespace.

func ResourceRestored

func ResourceRestored(ctx context.Context, resource string) error

ResourceRestored waits for a previously removed resource to be re-created with matching spec or data. Polls with timeout.

func ScenarioCleanup

func ScenarioCleanup(ctx context.Context, _ *godog.Scenario, err error) (context.Context, error)

func SendMetricsRequest

func SendMetricsRequest(ctx context.Context, serviceAccount string, endpoint string, controllerName string) error

SendMetricsRequest sets up port-forwarding to the controller's service pods and waits for the metrics endpoint to return a successful response. Stores the response body per pod in the scenario context. Polls with timeout.

func ServiceAccountIsAvailableInNamespace

func ServiceAccountIsAvailableInNamespace(ctx context.Context, serviceAccount string) error

ServiceAccountIsAvailableInNamespace creates a ServiceAccount in the test namespace without RBAC permissions.

func ServiceAccountWithClusterAdminPermissionsIsAvailableInNamespace

func ServiceAccountWithClusterAdminPermissionsIsAvailableInNamespace(ctx context.Context, serviceAccount string) error

ServiceAccountWithClusterAdminPermissionsIsAvailableInNamespace creates a ServiceAccount and applies cluster-admin RBAC.

func ServiceAccountWithFetchMetricsPermissions

func ServiceAccountWithFetchMetricsPermissions(ctx context.Context, serviceAccount string, controllerName string) error

ServiceAccountWithFetchMetricsPermissions creates a ServiceAccount and applies metrics-reader RBAC for the specified controller.

func ServiceAccountWithNeededPermissionsIsAvailableInNamespace

func ServiceAccountWithNeededPermissionsIsAvailableInNamespace(ctx context.Context, serviceAccount string) error

ServiceAccountWithNeededPermissionsIsAvailableInNamespace creates a ServiceAccount and applies standard RBAC permissions.

func SetCRDFieldMinValue

func SetCRDFieldMinValue(_ context.Context, resourceType, jsonPath string, minValue int) error

SetCRDFieldMinValue patches a CRD to set the minimum value for a field. jsonPath is in the format ".spec.fieldName" and gets converted to the CRD schema path.

func TagCatalogImage

func TagCatalogImage(name, oldTag, newTag string) error

TagCatalogImage adds a new tag to a catalog container image in the local registry using crane.

Types

This section is empty.

Jump to

Keyboard shortcuts

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