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

K8s namespace issues #269

Closed
wants to merge 5 commits into from
Closed
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
4 changes: 3 additions & 1 deletion src/nanorc/k8spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def create_namespace(self, namespace : str):
nslist = [ns.metadata.name for ns in self._core_v1_api.list_namespace().items]
if namespace in nslist:
self.log.debug(f"Not creating \"{namespace}\" namespace as it already exist")
self.log.info(f"Try `kubectl get pods -n {namespace}' and see if there is anything running")
self.log.info(f"If you are sure nothing is running and want to use same session name `kubectl delete ns {namespace}' before starting your next run")
return

self.log.info(f"Creating \"{namespace}\" namespace")
Expand Down Expand Up @@ -202,7 +204,7 @@ def create_namespace(self, namespace : str):
def delete_namespace(self, namespace: str):
nslist = [ns.metadata.name for ns in self._core_v1_api.list_namespace().items]
if not namespace in nslist:
self.log.debug(f"Not deleting \"{namespace}\" namespace as it already exist")
self.log.info(f"The \"{namespace}\" namespace has already been deleted")
return
self.log.info(f"Deleting \"{namespace}\" namespace")
try:
Expand Down