Skip to content

Commit 56fa5c0

Browse files
authored
Update ocp.py
1 parent cc0750f commit 56fa5c0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/mas/devops/ocp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def getNamespace(dynClient: DynamicClient, namespace: str) -> dict:
9494
return {}
9595

9696

97-
def createNamespace(dynClient: DynamicClient, namespace: str, kyvernoLabel: str = '') -> bool:
97+
def createNamespace(dynClient: DynamicClient, namespace: str, kyvernoLabel: str = None) -> bool:
9898
"""
9999
Create a namespace if it does not exist
100100
"""
@@ -110,9 +110,9 @@ def createNamespace(dynClient: DynamicClient, namespace: str, kyvernoLabel: str
110110
"name": namespace
111111
}
112112
}
113-
if kyvernoLabel is not None and kyvernoLabel == "audit":
113+
if kyvernoLabel is not None:
114114
nsObj["metadata"]["labels"] = {
115-
"ibm.com/kyverno": "audit"
115+
"ibm.com/kyverno": kyvernoLabel
116116
}
117117
namespaceAPI.create(body=nsObj)
118118
logger.debug(f"Created namespace {namespace}")

0 commit comments

Comments
 (0)