Skip to content

Commit a9dba1e

Browse files
Merge pull request #390 from diakovnec/disable_MustGather_CRs
[SREP-1045] Disabled e-2-e test due to missing MustGather CRD
2 parents 6b39e86 + 47164a5 commit a9dba1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/e2e/validation_webhook_tests.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
1919
appsv1 "k8s.io/api/apps/v1"
2020
v1 "k8s.io/api/core/v1"
21+
apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
2122
"k8s.io/apimachinery/pkg/api/errors"
2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2324
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -348,6 +349,13 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
348349
It("allows backplane-cluster-admin to manage MustGather CRs", func(ctx context.Context) {
349350
backplanecadmin, err := client.Impersonate("backplane-cluster-admin", "system:serviceaccounts:backplane-cluster-admin")
350351
Expect(err).ShouldNot(HaveOccurred(), "Unable to setup impersonated backplane-cluster-admin client")
352+
crdClient, err := apiextensionsclientset.NewForConfig(backplanecadmin.GetConfig())
353+
Expect(err).ShouldNot(HaveOccurred(), "Unable to create CRD client")
354+
_, err = crdClient.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, "mustgathers.managed.openshift.io", metav1.GetOptions{})
355+
if err != nil {
356+
Skip("Skipping test: MustGather CRD not found in cluster")
357+
}
358+
351359
dynamicClient, err = dynamic.NewForConfig(backplanecadmin.GetConfig())
352360
Expect(err).ShouldNot(HaveOccurred(), "failed creating the dynamic client: %w", err)
353361

0 commit comments

Comments
 (0)