diff --git a/container_ci_suite/helm.py b/container_ci_suite/helm.py index 40797bf..a80be60 100644 --- a/container_ci_suite/helm.py +++ b/container_ci_suite/helm.py @@ -51,8 +51,6 @@ def __init__( self.delete_prj: bool = delete_prj self.create_prj: bool = True self.oc_api = OpenShiftAPI(create_prj=self.create_prj, delete_prj=self.delete_prj) - self.oc_api.create_prj = self.create_prj - self.oc_api.create_project() self.pod_json_data: dict = {} self.pod_name_prefix: str = "" self.namespace = self.set_namespace() diff --git a/container_ci_suite/openshift.py b/container_ci_suite/openshift.py index f9de7a9..8eafd1f 100644 --- a/container_ci_suite/openshift.py +++ b/container_ci_suite/openshift.py @@ -123,15 +123,16 @@ def delete_project(self): if not self.delete_prj: print("Deleting project is SUPPRESSED.") # project is not deleted by request user - pass - if self.shared_cluster: - print("Delete project on shared cluster") - self.delete_tenant_namespace() else: - run_oc_command("project default", json_output=False) - run_oc_command( - f"delete project {self.namespace} --grace-period=0 --force", json_output=False - ) + if self.shared_cluster: + print("Delete project on shared cluster") + self.delete_tenant_namespace() + else: + print(f"Deleting project {self.namespace}") + run_oc_command("project default", json_output=False) + run_oc_command( + f"delete project {self.namespace} --grace-period=0 --force", json_output=False + ) def run_command_in_pod(self, pod_name, command: str = "") -> str: output = run_oc_command(f"exec {pod_name} -- \"{command}\"") diff --git a/container_ci_suite/utils.py b/container_ci_suite/utils.py index 196c488..4527c5f 100644 --- a/container_ci_suite/utils.py +++ b/container_ci_suite/utils.py @@ -376,6 +376,7 @@ def load_shared_credentials(credential: str) -> Any: def is_share_cluster() -> bool: file_shared_cluster = load_shared_credentials("SHARED_CLUSTER") + print(f"Is shared cluster allowed? {file_shared_cluster}") if not file_shared_cluster: return False if file_shared_cluster in ["True", "true", "1", "yes", "Yes", "y", "Y"]: diff --git a/setup.py b/setup.py index 8cf4acb..70e354c 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ def get_requirements(): description='A python3 container CI tool for testing images.', long_description=long_description, long_description_content_type='text/markdown', - version="0.3.0", + version="0.3.2", keywords='tool,containers,images,tests', packages=find_packages(exclude=["tests"]), url="https://github.com/sclorg/container-ci-suite",