Skip to content

Commit

Permalink
Move namespace outside of if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Nov 21, 2024
1 parent 06960b2 commit 46682ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/_nebari/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ def _version_specific_upgrade(

argo_sa = ["argo-admin", "argo-dev", "argo-view"]

namespace = config.get("namespace", "default")

if kwargs.get("attempt_fixes", False):
try:
kubernetes.config.load_kube_config()
Expand All @@ -682,7 +684,6 @@ def _version_specific_upgrade(
else:
raise e

namespace = config.get("namespace", "default")
for sa in argo_sa:
api_instance = kubernetes.client.CoreV1Api()
try:
Expand All @@ -708,7 +709,7 @@ def _version_specific_upgrade(
(
*(
"kubectl delete sa",
f"-n {config.get('namespace', 'default')}",
f"-n {namespace}",
),
*argo_sa,
),
Expand Down

0 comments on commit 46682ab

Please sign in to comment.