@@ -59,7 +59,7 @@ def deploy(directory, debug, namespace):
59
59
if namespace :
60
60
click .echo ("Cannot specify a --namespace when deploying a namespaces chart." )
61
61
else :
62
- deploy_namespaces (directory )
62
+ deploy_namespaces (directory , debug )
63
63
else :
64
64
click .echo (
65
65
"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
233
233
Path (temp_override_file_path ).unlink ()
234
234
235
235
236
- def deploy_namespaces (directory : Path ):
236
+ def deploy_namespaces (directory : Path , debug : bool = False ):
237
237
namespaces_file_path = directory / NAMESPACES_FILE
238
238
defaults_file_path = directory / DEFAULTS_NAMESPACE_FILE
239
239
240
240
with namespaces_file_path .open () as f :
241
241
namespaces_file = yaml .safe_load (f )
242
242
243
243
for namespace in namespaces_file ["namespaces" ]:
244
- click .echo (f"Deploying namespace: { namespace .get ('name ' )} " )
244
+ click .echo (f"Deploying namespace: { namespace .get ('namespaceName ' )} " )
245
245
try :
246
246
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 ()}
249
249
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 } "
251
251
252
252
if namespace_config_override :
253
253
with tempfile .NamedTemporaryFile (
@@ -257,6 +257,9 @@ def deploy_namespaces(directory: Path):
257
257
temp_override_file_path = Path (temp_file .name )
258
258
cmd = f"{ cmd } -f { temp_override_file_path } "
259
259
260
+ if debug :
261
+ cmd += " --debug"
262
+
260
263
if not stream_command (cmd ):
261
264
click .echo (f"Failed to run Helm command: { cmd } " )
262
265
return
@@ -266,6 +269,7 @@ def deploy_namespaces(directory: Path):
266
269
finally :
267
270
if temp_override_file_path .exists ():
268
271
temp_override_file_path .unlink ()
272
+ print ("DONE!!!!!" )
269
273
270
274
271
275
def is_windows ():
0 commit comments