diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2020-09-22 16:47:04 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2020-09-22 16:47:04 +0200 |
commit | 3a3bd294ea8101c22896d8601fe2723861f73124 (patch) | |
tree | ce46c8bf606a5a81de2354e3931165b583da3a78 /functest_kubernetes/security | |
parent | aed4dd8a97dbfcb9d0558f2df8f8ef8696f2c421 (diff) |
Stop hardcoding ims- as generate_name
Change-Id: I3ea22a4050ff1eb609cffb61edc41c49fab44366
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest_kubernetes/security')
-rw-r--r-- | functest_kubernetes/security/security.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/functest_kubernetes/security/security.py b/functest_kubernetes/security/security.py index e590d059..378b2c22 100644 --- a/functest_kubernetes/security/security.py +++ b/functest_kubernetes/security/security.py @@ -46,6 +46,7 @@ class SecurityTesting(testcase.TestCase): self.output_log_name = 'functest-kubernetes.log' self.output_debug_log_name = 'functest-kubernetes.debug.log' self.namespace = "" + self.ns_generate_name = "security-" def deploy_job(self): """Run Security job @@ -56,7 +57,7 @@ class SecurityTesting(testcase.TestCase): assert self.job_name api_response = self.corev1.create_namespace( client.V1Namespace(metadata=client.V1ObjectMeta( - generate_name="ims-"))) + generate_name=self.ns_generate_name))) self.namespace = api_response.metadata.name self.__logger.debug("create_namespace: %s", api_response) with open(pkg_resources.resource_filename( @@ -128,6 +129,7 @@ class KubeHunter(SecurityTesting): def __init__(self, **kwargs): super(KubeHunter, self).__init__(**kwargs) self.job_name = "kube-hunter" + self.ns_generate_name = "kube-hunter-" def process_results(self, **kwargs): """Process kube-hunter details""" @@ -191,6 +193,11 @@ class KubeBench(SecurityTesting): __logger = logging.getLogger(__name__) + def __init__(self, **kwargs): + super(KubeBench, self).__init__(**kwargs) + self.job_name = "kube-bench" + self.ns_generate_name = "kube-bench-" + def run(self, **kwargs): self.job_name = "kube-bench-{}".format(kwargs.get("target", "node")) super(KubeBench, self).run(**kwargs) |