Skip to content

Commit

Permalink
Add default labels and annotations to Ray worker pods too. (#6107)
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan authored Dec 13, 2024
1 parent bd12812 commit e72f102
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flyteplugins/go/tasks/plugins/k8s/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,13 @@ func buildWorkerPodTemplate(primaryContainer *v1.Container, basePodSpec *v1.PodS

basePodSpec = flytek8s.AddTolerationsForExtendedResources(basePodSpec)

cfg := config.GetK8sPluginConfig()
podTemplateSpec := v1.PodTemplateSpec{
Spec: *basePodSpec,
ObjectMeta: *objectMetadata,
}
podTemplateSpec.SetLabels(pluginsUtils.UnionMaps(podTemplateSpec.GetLabels(), pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetLabels())))
podTemplateSpec.SetAnnotations(pluginsUtils.UnionMaps(podTemplateSpec.GetAnnotations(), pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetAnnotations())))
podTemplateSpec.SetLabels(pluginsUtils.UnionMaps(cfg.DefaultLabels, podTemplateSpec.GetLabels(), pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetLabels())))
podTemplateSpec.SetAnnotations(pluginsUtils.UnionMaps(cfg.DefaultAnnotations, podTemplateSpec.GetAnnotations(), pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetAnnotations())))
return podTemplateSpec, nil
}

Expand Down

0 comments on commit e72f102

Please sign in to comment.