From 94bda00c75ca09018022a2c5de7028ee9255e9fa Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 26 Aug 2024 16:10:49 +0300 Subject: [PATCH] test/e2e: drop the pod security admission hack The Kubernetes e2e framework now supports setting the pod security level. --- test/e2e/node_feature_discovery_test.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/e2e/node_feature_discovery_test.go b/test/e2e/node_feature_discovery_test.go index 38e0a49f0..d3d556fdb 100644 --- a/test/e2e/node_feature_discovery_test.go +++ b/test/e2e/node_feature_discovery_test.go @@ -200,6 +200,8 @@ func cleanupCRs(ctx context.Context, cli *nfdclient.Clientset, namespace string) // Actual test suite var _ = NFDDescribe(Label("nfd-master"), func() { f := framework.NewDefaultFramework("node-feature-discovery") + // nfd-worker needs host mounts + f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged Context("when deploying a single nfd-master pod", Ordered, func() { var ( @@ -234,14 +236,6 @@ var _ = NFDDescribe(Label("nfd-master"), func() { }) JustBeforeEach(func(ctx context.Context) { - // Drop the pod security admission label as nfd-worker needs host mounts - if _, ok := f.Namespace.Labels[admissionapi.EnforceLevelLabel]; ok { - framework.Logf("Deleting %s label from the test namespace", admissionapi.EnforceLevelLabel) - delete(f.Namespace.Labels, admissionapi.EnforceLevelLabel) - _, err := f.ClientSet.CoreV1().Namespaces().Update(ctx, f.Namespace, metav1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - } - err := testutils.ConfigureRBAC(ctx, f.ClientSet, f.Namespace.Name) Expect(err).NotTo(HaveOccurred())