Skip to content

Commit

Permalink
Remove unused environment variable (#5987)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgedik authored Nov 14, 2024
1 parent 24113f6 commit 93f00a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ func TestAddFlyteCustomizationsToContainer(t *testing.T) {
assert.EqualValues(t, container.Command, []string{"s3://input/path"})
assert.Len(t, container.Resources.Limits, 3)
assert.Len(t, container.Resources.Requests, 3)
assert.Len(t, container.Env, 13)
assert.Len(t, container.Env, 12)
}

func TestAddFlyteCustomizationsToContainer_Resources(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ func GetExecutionEnvVars(id pluginsCore.TaskExecutionID, consoleURL string) []v1
Name: "FLYTE_INTERNAL_EXECUTION_DOMAIN",
Value: nodeExecutionID.Domain,
},
{
// FLYTE_INTERNAL_POD_NAME
Name: "_F_PN",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{
FieldPath: "metadata.name",
},
},
},
{
Name: "FLYTE_ATTEMPT_NUMBER",
Value: attemptNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func TestGetExecutionEnvVars(t *testing.T) {
}{
{
"no-console-url",
13,
12,
"",
nil,
},
{
"with-console-url",
14,
13,
"scheme://host/path",
&v12.EnvVar{
Name: "FLYTE_EXECUTION_URL",
Expand All @@ -42,7 +42,7 @@ func TestGetExecutionEnvVars(t *testing.T) {
},
{
"with-console-url-ending-in-single-slash",
14,
13,
"scheme://host/path/",
&v12.EnvVar{
Name: "FLYTE_EXECUTION_URL",
Expand All @@ -51,7 +51,7 @@ func TestGetExecutionEnvVars(t *testing.T) {
},
{
"with-console-url-ending-in-multiple-slashes",
14,
13,
"scheme://host/path////",
&v12.EnvVar{
Name: "FLYTE_EXECUTION_URL",
Expand All @@ -63,7 +63,7 @@ func TestGetExecutionEnvVars(t *testing.T) {
envVars := GetExecutionEnvVars(mock, tt.consoleURL)
assert.Len(t, envVars, tt.expectedEnvVars)
if tt.expectedEnvVar != nil {
assert.True(t, proto.Equal(&envVars[5], tt.expectedEnvVar))
assert.True(t, proto.Equal(&envVars[4], tt.expectedEnvVar))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ func TestBuildResourcePodTemplate(t *testing.T) {
assert.Equal(t, defaultConfig.DefaultEnvVars["foo"], findEnvVarByName(sparkApp.Spec.Driver.Env, "foo").Value)
assert.Equal(t, defaultConfig.DefaultEnvVars["fooEnv"], findEnvVarByName(sparkApp.Spec.Driver.Env, "fooEnv").Value)
assert.Equal(t, findEnvVarByName(dummyEnvVarsWithSecretRef, "SECRET"), findEnvVarByName(sparkApp.Spec.Driver.Env, "SECRET"))
assert.Equal(t, 10, len(sparkApp.Spec.Driver.Env))
assert.Equal(t, 9, len(sparkApp.Spec.Driver.Env))
assert.Equal(t, testImage, *sparkApp.Spec.Driver.Image)
assert.Equal(t, flytek8s.GetServiceAccountNameFromTaskExecutionMetadata(taskCtx.TaskExecutionMetadata()), *sparkApp.Spec.Driver.ServiceAccount)
assert.Equal(t, defaultConfig.DefaultPodSecurityContext, sparkApp.Spec.Driver.SecurityContenxt)
Expand Down Expand Up @@ -890,7 +890,7 @@ func TestBuildResourcePodTemplate(t *testing.T) {
assert.Equal(t, defaultConfig.DefaultEnvVars["foo"], findEnvVarByName(sparkApp.Spec.Executor.Env, "foo").Value)
assert.Equal(t, defaultConfig.DefaultEnvVars["fooEnv"], findEnvVarByName(sparkApp.Spec.Executor.Env, "fooEnv").Value)
assert.Equal(t, findEnvVarByName(dummyEnvVarsWithSecretRef, "SECRET"), findEnvVarByName(sparkApp.Spec.Executor.Env, "SECRET"))
assert.Equal(t, 10, len(sparkApp.Spec.Executor.Env))
assert.Equal(t, 9, len(sparkApp.Spec.Executor.Env))
assert.Equal(t, testImage, *sparkApp.Spec.Executor.Image)
assert.Equal(t, defaultConfig.DefaultPodSecurityContext, sparkApp.Spec.Executor.SecurityContenxt)
assert.Equal(t, defaultConfig.DefaultPodDNSConfig, sparkApp.Spec.Executor.DNSConfig)
Expand Down

0 comments on commit 93f00a1

Please sign in to comment.