@@ -132,8 +132,9 @@ def delete_pod(pod_name, namespace):
132132
133133 # Delete remaining pods
134134 pods = get_pods ()
135- for pod in pods .items :
136- futures .append (executor .submit (delete_pod , pod .metadata .name , pod .metadata .namespace ))
135+ for pod_list in pods :
136+ for pod in pod_list .items :
137+ futures .append (executor .submit (delete_pod , pod .metadata .name , pod .metadata .namespace ))
137138
138139 # Wait for all tasks to complete and print results
139140 for future in as_completed (futures ):
@@ -159,9 +160,10 @@ def get_active_network(namespace):
159160
160161
161162@click .command (context_settings = {"ignore_unknown_options" : True })
163+ @click .option ("--namespace" , "-n" , type = str , help = "Namespace to run scenario in (overrides the current namespace in kubectl)" )
162164@click .argument ("scenario_file" , type = click .Path (exists = True , file_okay = True , dir_okay = False ))
163165@click .argument ("additional_args" , nargs = - 1 , type = click .UNPROCESSED )
164- def run (scenario_file : str , additional_args : tuple [str ]):
166+ def run (namespace : str , scenario_file : str , additional_args : tuple [str ]):
165167 """
166168 Run a scenario from a file.
167169 Pass `-- --help` to get individual scenario help
@@ -173,7 +175,7 @@ def run(scenario_file: str, additional_args: tuple[str]):
173175 scenario_data = base64 .b64encode (file .read ()).decode ()
174176
175177 name = f"commander-{ scenario_name .replace ('_' , '' )} -{ int (time .time ())} "
176- namespace = get_default_namespace ()
178+ ns = namespace if namespace else get_default_namespace ()
177179 tankpods = get_mission ("tank" )
178180 tanks = [
179181 {
@@ -198,7 +200,7 @@ def run(scenario_file: str, additional_args: tuple[str]):
198200 "upgrade" ,
199201 "--install" ,
200202 "--namespace" ,
201- namespace ,
203+ ns ,
202204 "--set" ,
203205 f"fullnameOverride={ name } " ,
204206 "--set" ,
0 commit comments