Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused environment variable #5987

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading