From 489ed0dd50c84d63f120df49188c8d5c35484343 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Tue, 28 May 2024 14:35:20 +0200 Subject: [PATCH] keep EnvFrom from pod template not complete nor tested, just as hint for potential fix for regression in https://github.com/flyteorg/flyte/pull/4969 --- .../go/tasks/pluginmachinery/flytek8s/container_helper.go | 2 +- .../go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go index fdaec7256c..249940fab8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go @@ -292,7 +292,7 @@ func AddFlyteCustomizationsToContainer(ctx context.Context, parameters template. } container.Args = modifiedArgs - container.Env, container.EnvFrom = DecorateEnvVars(ctx, container.Env, parameters.TaskExecMetadata.GetEnvironmentVariables(), parameters.TaskExecMetadata.GetTaskExecutionID()) + container.Env, container.EnvFrom = DecorateEnvVars(ctx, container.Env, container.EnvFrom, parameters.TaskExecMetadata.GetEnvironmentVariables(), parameters.TaskExecMetadata.GetTaskExecutionID()) // retrieve platformResources and overrideResources to use when aggregating container resources platformResources := parameters.TaskExecMetadata.GetPlatformResources() diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go index b235725edd..3f4440f4df 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go @@ -113,7 +113,7 @@ func GetExecutionEnvVars(id pluginsCore.TaskExecutionID) []v1.EnvVar { return envVars } -func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, taskEnvironmentVariables map[string]string, id pluginsCore.TaskExecutionID) ([]v1.EnvVar, []v1.EnvFromSource) { +func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, envFroms []v1.EnvFromSource, taskEnvironmentVariables map[string]string, id pluginsCore.TaskExecutionID) ([]v1.EnvVar, []v1.EnvFromSource) { envVars = append(envVars, GetContextEnvVars(ctx)...) envVars = append(envVars, GetExecutionEnvVars(id)...) @@ -128,8 +128,6 @@ func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, taskEnvironmentVa envVars = append(envVars, v1.EnvVar{Name: k, Value: value}) } - envFroms := []v1.EnvFromSource{} - for _, secretName := range config.GetK8sPluginConfig().DefaultEnvFromSecrets { optional := true secretRef := v1.SecretEnvSource{LocalObjectReference: v1.LocalObjectReference{Name: secretName}, Optional: &optional}