aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes/security/security.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2024-01-13 11:35:36 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2024-01-13 11:37:57 +0100
commitfc9e1aae3c434e2e36d98805538ded767ec8dede (patch)
tree96b7d6d56794932fd4f98d8335c75fc9a504716d /functest_kubernetes/security/security.py
parented36cd525f4bee23229aa2b24a6b1a6b380e425d (diff)
Enforce baseline Pod Security Standard
It allows running both security and ims testcases vs clusters where PodSecurityConfiguration enforces "restricted" [1]. [1] https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/ Change-Id: I9eb420cbb695ec8fb002f25cfd3c96ab50118fcc Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 553d57ffd4ff9c3c4f319454a4d190ac7aa4cc76)
Diffstat (limited to 'functest_kubernetes/security/security.py')
-rw-r--r--functest_kubernetes/security/security.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/functest_kubernetes/security/security.py b/functest_kubernetes/security/security.py
index f03845a4..997a0b7a 100644
--- a/functest_kubernetes/security/security.py
+++ b/functest_kubernetes/security/security.py
@@ -61,7 +61,8 @@ class SecurityTesting(testcase.TestCase):
assert self.job_name
api_response = self.corev1.create_namespace(
client.V1Namespace(metadata=client.V1ObjectMeta(
- generate_name=self.ns_generate_name)))
+ generate_name=self.ns_generate_name,
+ labels={"pod-security.kubernetes.io/enforce": "baseline"})))
self.namespace = api_response.metadata.name
self.__logger.debug("create_namespace: %s", api_response)
with open(pkg_resources.resource_filename(