From e72f102aebc1f6c3062d999c714123b4d05de8e4 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Fri, 13 Dec 2024 18:15:56 +0100 Subject: [PATCH] Add default labels and annotations to Ray worker pods too. (#6107) Signed-off-by: Katrina Rogan --- flyteplugins/go/tasks/plugins/k8s/ray/ray.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go index dce40b2c93..76e595b006 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go @@ -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 }