@@ -240,26 +240,29 @@ def get_active_network(namespace):
240
240
"--source_dir" , type = click .Path (exists = True , file_okay = False , dir_okay = True ), required = False
241
241
)
242
242
@click .argument ("additional_args" , nargs = - 1 , type = click .UNPROCESSED )
243
+ @click .option ("--admin" , is_flag = True , default = False , show_default = False )
243
244
@click .option ("--namespace" , default = None , show_default = True )
244
245
def run (
245
246
scenario_file : str ,
246
247
debug : bool ,
247
248
source_dir ,
248
249
additional_args : tuple [str ],
250
+ admin : bool ,
249
251
namespace : Optional [str ],
250
252
):
251
253
"""
252
254
Run a scenario from a file.
253
255
Pass `-- --help` to get individual scenario help
254
256
"""
255
- return _run (scenario_file , debug , source_dir , additional_args , namespace )
257
+ return _run (scenario_file , debug , source_dir , additional_args , admin , namespace )
256
258
257
259
258
260
def _run (
259
261
scenario_file : str ,
260
262
debug : bool ,
261
263
source_dir ,
262
264
additional_args : tuple [str ],
265
+ admin : bool ,
263
266
namespace : Optional [str ],
264
267
) -> str :
265
268
namespace = get_default_namespace_or (namespace )
@@ -329,6 +332,8 @@ def filter(path):
329
332
]
330
333
331
334
# Add additional arguments
335
+ if admin :
336
+ helm_command .extend (["--set" , "admin=true" ])
332
337
if additional_args :
333
338
helm_command .extend (["--set" , f"args={ ' ' .join (additional_args )} " ])
334
339
@@ -347,6 +352,7 @@ def filter(path):
347
352
except subprocess .CalledProcessError as e :
348
353
print (f"Failed to deploy scenario commander: { scenario_name } " )
349
354
print (f"Error: { e .stderr } " )
355
+ return None
350
356
351
357
# upload scenario files and network data to the init container
352
358
wait_for_init (name , namespace = namespace )
0 commit comments