@@ -309,11 +309,7 @@ def get_default_kueue_name(namespace: str):
309309
310310
311311def write_components (
312- user_yaml : dict ,
313- output_file_name : str ,
314- namespace : str ,
315- local_queue : Optional [str ],
316- user_labels : dict ,
312+ user_yaml : dict , output_file_name : str , namespace : str , local_queue : Optional [str ]
317313):
318314 # Create the directory if it doesn't exist
319315 directory_path = os .path .dirname (output_file_name )
@@ -335,8 +331,6 @@ def write_components(
335331 ]
336332 labels = component ["generictemplate" ]["metadata" ]["labels" ]
337333 labels .update ({"kueue.x-k8s.io/queue-name" : lq_name })
338- for key in user_labels :
339- labels .update ({key : user_labels [key ]})
340334 outfile .write ("---\n " )
341335 yaml .dump (
342336 component ["generictemplate" ], outfile , default_flow_style = False
@@ -345,11 +339,7 @@ def write_components(
345339
346340
347341def load_components (
348- user_yaml : dict ,
349- name : str ,
350- namespace : str ,
351- local_queue : Optional [str ],
352- user_labels : dict ,
342+ user_yaml : dict , name : str , namespace : str , local_queue : Optional [str ]
353343):
354344 component_list = []
355345 components = user_yaml .get ("spec" , "resources" )["resources" ].get ("GenericItems" )
@@ -365,8 +355,6 @@ def load_components(
365355 ]
366356 labels = component ["generictemplate" ]["metadata" ]["labels" ]
367357 labels .update ({"kueue.x-k8s.io/queue-name" : lq_name })
368- for key in user_labels :
369- labels .update ({key : user_labels [key ]})
370358 component_list .append (component ["generictemplate" ])
371359
372360 resources = "---\n " + "---\n " .join (
@@ -407,7 +395,6 @@ def generate_appwrapper(
407395 write_to_file : bool ,
408396 verify_tls : bool ,
409397 local_queue : Optional [str ],
410- user_labels ,
411398):
412399 user_yaml = read_template (template )
413400 appwrapper_name , cluster_name = gen_names (name )
@@ -459,13 +446,11 @@ def generate_appwrapper(
459446 if mcad :
460447 write_user_appwrapper (user_yaml , outfile )
461448 else :
462- write_components (user_yaml , outfile , namespace , local_queue , user_labels )
449+ write_components (user_yaml , outfile , namespace , local_queue )
463450 return outfile
464451 else :
465452 if mcad :
466453 user_yaml = load_appwrapper (user_yaml , name )
467454 else :
468- user_yaml = load_components (
469- user_yaml , name , namespace , local_queue , user_labels
470- )
455+ user_yaml = load_components (user_yaml , name , namespace , local_queue )
471456 return user_yaml
0 commit comments