Skip to content

Commit

Permalink
Merge pull request #1854 from marquiz/devel/e2e-podsecurity
Browse files Browse the repository at this point in the history
test/e2e: drop the pod security admission hack
  • Loading branch information
k8s-ci-robot committed Aug 26, 2024
2 parents 8c3cb31 + 94bda00 commit 1fa31a5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/e2e/node_feature_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit 1fa31a5

Please sign in to comment.