File tree Expand file tree Collapse file tree
sdk/python/kubeflow/training/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -598,12 +598,11 @@ def create_job(
598598 )
599599
600600 # Handle Kueue queue validation and labeling
601- if queue_name is not None :
602- queue_exists = self ._check_queue_exists (queue_name , namespace )
603- if queue_exists is not False :
604- if job .metadata .labels is None :
605- job .metadata .labels = {}
606- job .metadata .labels [constants .LOCAL_QUEUE_LABEL ] = queue_name
601+ if queue_name and queue_name .strip ():
602+ self ._check_queue_exists (queue_name , namespace )
603+ if job .metadata .labels is None :
604+ job .metadata .labels = {}
605+ job .metadata .labels [constants .LOCAL_QUEUE_LABEL ] = queue_name
607606
608607 # Create the Training Job.
609608 try :
Original file line number Diff line number Diff line change @@ -697,6 +697,21 @@ def __init__(self):
697697 labels = None ,
698698 ),
699699 ),
700+ (
701+ "valid flow with empty queue name" ,
702+ {
703+ "name" : TEST_NAME ,
704+ "namespace" : TEST_NAME ,
705+ "base_image" : TEST_IMAGE ,
706+ "num_workers" : 1 ,
707+ "queue_name" : "" ,
708+ },
709+ SUCCESS ,
710+ create_job (
711+ num_workers = 1 ,
712+ labels = None ,
713+ ),
714+ ),
700715 (
701716 "valid flow with non-existent queue" ,
702717 {
@@ -709,7 +724,7 @@ def __init__(self):
709724 SUCCESS ,
710725 create_job (
711726 num_workers = 1 ,
712- labels = None ,
727+ labels = { constants . LOCAL_QUEUE_LABEL : "non-existent-queue" } ,
713728 ),
714729 ),
715730 (
You can’t perform that action at this time.
0 commit comments