Skip to content

Commit

Permalink
[patch] Fix bug in getNamespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa Resul committed Jan 12, 2025
1 parent 0830980 commit 003a078
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mas/devops/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def getNamespace(dynClient: DynamicClient, namespace: str) -> dict:
Get a namespace
"""
namespaceAPI = dynClient.resources.get(api_version="v1", kind="Namespace")
namespace = {}

try:
namespace = namespaceAPI.get(name=namespace)
ns = namespaceAPI.get(name=namespace)
logger.debug(f"Namespace {namespace} exists")
return ns
except NotFoundError:
logger.debug(f"Namespace {namespace} does not exist")

return namespace
return {}


def createNamespace(dynClient: DynamicClient, namespace: str) -> bool:
Expand Down

0 comments on commit 003a078

Please sign in to comment.