utils

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: 29 Imported by: 0

Documentation

Overview

Package utils provides helper functions for e2e tests, including feature gate detection and validation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClusterRoleAndBindingForSA

func CreateClusterRoleAndBindingForSA(ctx context.Context, name string, sa *corev1.ServiceAccount, clusterExtensionName string) error

func CreateNamespace

func CreateNamespace(ctx context.Context, name string) (*corev1.Namespace, error)

func CreateServiceAccount

func CreateServiceAccount(ctx context.Context, name types.NamespacedName, clusterExtensionName string) (*corev1.ServiceAccount, error)

func CreateTestCatalog

func CreateTestCatalog(ctx context.Context, name string, imageRef string) (*ocv1.ClusterCatalog, error)

CreateTestCatalog will create a new catalog on the test cluster, provided the context, catalog name, and the image reference. It returns the created catalog or an error if any errors occurred while creating the catalog. Note that catalogd will automatically create the label:

"olm.operatorframework.io/metadata.name": name

func EnsureNoExtensionResources

func EnsureNoExtensionResources(t *testing.T, clusterExtensionName string)

func SkipIfFeatureGateDisabled

func SkipIfFeatureGateDisabled(t *testing.T, fg string)

SkipIfFeatureGateDisabled skips the test if the specified feature gate is disabled. It queries the OLM deployments to detect feature gate settings and falls back to programmatic defaults if the feature gate is not explicitly configured.

func TestCleanup

func TestCleanup(t *testing.T, cat *ocv1.ClusterCatalog, clusterExtension *ocv1.ClusterExtension, sa *corev1.ServiceAccount, ns *corev1.Namespace)

func TestInitClusterExtensionClusterCatalog

func TestInitClusterExtensionClusterCatalog(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog)

func TestInitServiceAccountNamespace

func TestInitServiceAccountNamespace(t *testing.T, clusterExtensionName string) (*corev1.ServiceAccount, *corev1.Namespace)

func ValidateCatalogUnpack

func ValidateCatalogUnpack(t *testing.T)

ValidateCatalogUnpack validates that the test catalog with the default name has unpacked successfully. Deprecated: Use ValidateCatalogUnpackWithName for tests that use unique catalog names.

func ValidateCatalogUnpackWithName added in v1.8.0

func ValidateCatalogUnpackWithName(t *testing.T, catalogName string)

ValidateCatalogUnpackWithName validates that a catalog with the given name has unpacked successfully.

Types

This section is empty.

Jump to

Keyboard shortcuts

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