@@ -240,26 +240,29 @@ def get_active_network(namespace):
240240 "--source_dir" , type = click .Path (exists = True , file_okay = False , dir_okay = True ), required = False
241241)
242242@click .argument ("additional_args" , nargs = - 1 , type = click .UNPROCESSED )
243+ @click .option ("--admin" , is_flag = True , default = False , show_default = False )
243244@click .option ("--namespace" , default = None , show_default = True )
244245def run (
245246 scenario_file : str ,
246247 debug : bool ,
247248 source_dir ,
248249 additional_args : tuple [str ],
250+ admin : bool ,
249251 namespace : Optional [str ],
250252):
251253 """
252254 Run a scenario from a file.
253255 Pass `-- --help` to get individual scenario help
254256 """
255- return _run (scenario_file , debug , source_dir , additional_args , namespace )
257+ return _run (scenario_file , debug , source_dir , additional_args , admin , namespace )
256258
257259
258260def _run (
259261 scenario_file : str ,
260262 debug : bool ,
261263 source_dir ,
262264 additional_args : tuple [str ],
265+ admin : bool ,
263266 namespace : Optional [str ],
264267) -> str :
265268 namespace = get_default_namespace_or (namespace )
@@ -329,6 +332,8 @@ def filter(path):
329332 ]
330333
331334 # Add additional arguments
335+ if admin :
336+ helm_command .extend (["--set" , "admin=true" ])
332337 if additional_args :
333338 helm_command .extend (["--set" , f"args={ ' ' .join (additional_args )} " ])
334339
@@ -347,6 +352,7 @@ def filter(path):
347352 except subprocess .CalledProcessError as e :
348353 print (f"Failed to deploy scenario commander: { scenario_name } " )
349354 print (f"Error: { e .stderr } " )
355+ return None
350356
351357 # upload scenario files and network data to the init container
352358 wait_for_init (name , namespace = namespace )
0 commit comments