Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create project twice. #78

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions container_ci_suite/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
17 changes: 9 additions & 8 deletions container_ci_suite/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"")
Expand Down
1 change: 1 addition & 0 deletions container_ci_suite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading