From 6509fd422dc6f4c6b759f71fe357ea82d569ace9 Mon Sep 17 00:00:00 2001 From: Dennis Keck <26092524+fellhorn@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:10:13 +0200 Subject: [PATCH 1/2] Feat: Expose nodeID to container Signed-off-by: Dennis Keck <26092524+fellhorn@users.noreply.github.com> --- .../tasks/pluginmachinery/flytek8s/k8s_resource_adds.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go index 49efef455c..fd4a8fbbbc 100755 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go @@ -31,6 +31,15 @@ func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar { }, ) } + + if nodeId := contextutils.Value(ownerCtx, contextutils.NodeIDKey); nodeId != "" { + envVars = append(envVars, + v1.EnvVar{ + Name: "FLYTE_INTERNAL_NODE_ID", + Value: nodeId, + }, + ) + } return envVars } From dff82ed202bdb37c794c5a70a4ebfc9b7ad64077 Mon Sep 17 00:00:00 2001 From: Dennis Keck <26092524+fellhorn@users.noreply.github.com> Date: Mon, 14 Aug 2023 20:37:09 +0200 Subject: [PATCH 2/2] Linting Signed-off-by: Dennis Keck <26092524+fellhorn@users.noreply.github.com> --- .../go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go index fd4a8fbbbc..1fdb10a1e5 100755 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go @@ -32,11 +32,11 @@ func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar { ) } - if nodeId := contextutils.Value(ownerCtx, contextutils.NodeIDKey); nodeId != "" { + if nodeID := contextutils.Value(ownerCtx, contextutils.NodeIDKey); nodeID != "" { envVars = append(envVars, v1.EnvVar{ Name: "FLYTE_INTERNAL_NODE_ID", - Value: nodeId, + Value: nodeID, }, ) }