@@ -318,6 +318,7 @@ func (ctl *controller) getCurrentLaunchersOnNode(ctx context.Context, key NodeLa
318318 launcherLabels := map [string ]string {
319319 ComponentLabelKey : LauncherComponentLabelValue ,
320320 LauncherConfigNameLabelKey : key .LauncherConfigName ,
321+ NodeNameLabelKey : key .NodeName ,
321322 }
322323 // Use podLister's List method with label selector
323324 pods , err := ctl .podLister .List (labels .SelectorFromSet (launcherLabels ))
@@ -328,9 +329,7 @@ func (ctl *controller) getCurrentLaunchersOnNode(ctx context.Context, key NodeLa
328329 // Filter pods that are on the specified node
329330 var filteredPods []corev1.Pod
330331 for _ , pod := range pods {
331- if pod .Spec .NodeName == key .NodeName {
332- filteredPods = append (filteredPods , * pod )
333- }
332+ filteredPods = append (filteredPods , * pod )
334333 }
335334
336335 return filteredPods , nil
@@ -394,6 +393,7 @@ func (ctl *controller) buildPodFromTemplate(template corev1.PodTemplateSpec, key
394393 pod .Labels [ComponentLabelKey ] = LauncherComponentLabelValue
395394 pod .Labels [LauncherGeneratedByLabelKey ] = LauncherGeneratedByLabelValue
396395 pod .Labels [LauncherConfigNameLabelKey ] = key .LauncherConfigName
396+ pod .Labels [NodeNameLabelKey ] = key .NodeName
397397 // Assign to specific node
398398 pod .Spec .NodeName = key .NodeName
399399 return pod
0 commit comments