1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

test/e2e: drop the pod security admission hack

The Kubernetes e2e framework now supports setting the pod security
level.
This commit is contained in:
Markus Lehtonen 2024-08-26 16:10:49 +03:00
parent 8c3cb31114
commit 94bda00c75

View file

@ -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())