Documentation
¶
Overview ¶
Package utils provides helper functions for e2e tests, including feature gate detection and validation utilities.
Index ¶
- func CreateClusterRoleAndBindingForSA(ctx context.Context, name string, sa *corev1.ServiceAccount, ...) error
- func CreateNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
- func CreateServiceAccount(ctx context.Context, name types.NamespacedName, clusterExtensionName string) (*corev1.ServiceAccount, error)
- func CreateTestCatalog(ctx context.Context, name string, imageRef string) (*ocv1.ClusterCatalog, error)
- func EnsureNoExtensionResources(t *testing.T, clusterExtensionName string)
- func SkipIfFeatureGateDisabled(t *testing.T, fg string)
- func TestCleanup(t *testing.T, cat *ocv1.ClusterCatalog, ...)
- func TestInit(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog, *corev1.ServiceAccount, ...)
- func TestInitClusterExtensionClusterCatalog(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog)
- func TestInitServiceAccountNamespace(t *testing.T, clusterExtensionName string) (*corev1.ServiceAccount, *corev1.Namespace)
- func ValidateCatalogUnpack(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
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 SkipIfFeatureGateDisabled ¶
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 TestInit ¶
func TestInit(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog, *corev1.ServiceAccount, *corev1.Namespace)
func TestInitClusterExtensionClusterCatalog ¶
func TestInitClusterExtensionClusterCatalog(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog)
func ValidateCatalogUnpack ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.