@@ -59,7 +59,7 @@ def deploy(directory, debug, namespace):
5959 if namespace :
6060 click .echo ("Cannot specify a --namespace when deploying a namespaces chart." )
6161 else :
62- deploy_namespaces (directory )
62+ deploy_namespaces (directory , debug )
6363 else :
6464 click .echo (
6565 "Error: Neither network.yaml nor namespaces.yaml found in the specified directory."
@@ -233,21 +233,21 @@ def deploy_network(directory: Path, namespace_override: str, debug: bool = False
233233 Path (temp_override_file_path ).unlink ()
234234
235235
236- def deploy_namespaces (directory : Path ):
236+ def deploy_namespaces (directory : Path , debug : bool = False ):
237237 namespaces_file_path = directory / NAMESPACES_FILE
238238 defaults_file_path = directory / DEFAULTS_NAMESPACE_FILE
239239
240240 with namespaces_file_path .open () as f :
241241 namespaces_file = yaml .safe_load (f )
242242
243243 for namespace in namespaces_file ["namespaces" ]:
244- click .echo (f"Deploying namespace: { namespace .get ('name ' )} " )
244+ click .echo (f"Deploying namespace: { namespace .get ('namespaceName ' )} " )
245245 try :
246246 temp_override_file_path = Path ()
247- namespace_name = namespace .get ("name " )
248- namespace_config_override = {k : v for k , v in namespace .items () if k != "name" }
247+ namespace_name = namespace .get ("namespaceName " )
248+ namespace_config_override = {k : v for k , v in namespace .items ()}
249249
250- cmd = f"{ HELM_COMMAND } { namespace_name } { NAMESPACES_CHART_LOCATION } -f { defaults_file_path } --set type={ WARNET_ASSETS } "
250+ cmd = f"{ HELM_COMMAND } --create-namespace { namespace_name } { NAMESPACES_CHART_LOCATION } -f { defaults_file_path } --set type={ WARNET_ASSETS } "
251251
252252 if namespace_config_override :
253253 with tempfile .NamedTemporaryFile (
@@ -257,6 +257,9 @@ def deploy_namespaces(directory: Path):
257257 temp_override_file_path = Path (temp_file .name )
258258 cmd = f"{ cmd } -f { temp_override_file_path } "
259259
260+ if debug :
261+ cmd += " --debug"
262+
260263 if not stream_command (cmd ):
261264 click .echo (f"Failed to run Helm command: { cmd } " )
262265 return
@@ -266,6 +269,7 @@ def deploy_namespaces(directory: Path):
266269 finally :
267270 if temp_override_file_path .exists ():
268271 temp_override_file_path .unlink ()
272+ print ("DONE!!!!!" )
269273
270274
271275def is_windows ():
0 commit comments