From b8f7df88cce8a272b9007c249d48bbbf2e0e05cb Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Tue, 26 Nov 2024 20:08:35 +0100 Subject: [PATCH 1/2] Change JobSink execution mode variable to `K_EXECUTION_MODE` Align to `K_SINK`. Signed-off-by: Pierangelo Di Pilato --- pkg/apis/sinks/v1alpha1/job_sink_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/sinks/v1alpha1/job_sink_types.go b/pkg/apis/sinks/v1alpha1/job_sink_types.go index da69766bdd0..5cc3a0faf61 100644 --- a/pkg/apis/sinks/v1alpha1/job_sink_types.go +++ b/pkg/apis/sinks/v1alpha1/job_sink_types.go @@ -29,7 +29,7 @@ import ( ) const ( - ExecutionModeEnvVar = "KNATIVE_EXECUTION_MODE" + ExecutionModeEnvVar = "K_EXECUTION_MODE" ) type ExecutionMode string From e270746c78121b02e89cb36abaa991e7461993c0 Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Wed, 27 Nov 2024 17:28:56 +0100 Subject: [PATCH 2/2] Fix tests Signed-off-by: Pierangelo Di Pilato --- pkg/apis/sinks/v1alpha1/job_sink_defaults_test.go | 14 +++++++------- pkg/reconciler/jobsink/jobsink_test.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/apis/sinks/v1alpha1/job_sink_defaults_test.go b/pkg/apis/sinks/v1alpha1/job_sink_defaults_test.go index 766ab45b0d6..a3ed1ed76ed 100644 --- a/pkg/apis/sinks/v1alpha1/job_sink_defaults_test.go +++ b/pkg/apis/sinks/v1alpha1/job_sink_defaults_test.go @@ -50,7 +50,7 @@ func TestSetDefaults(t *testing.T) { Name: "cnt3", Image: "img3", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "something"}, + {Name: "K_EXECUTION_MODE", Value: "something"}, }, }, }, @@ -63,7 +63,7 @@ func TestSetDefaults(t *testing.T) { Name: "cnt-ini2", Image: "img-ini2", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "something"}, + {Name: "K_EXECUTION_MODE", Value: "something"}, }, }, }, @@ -84,14 +84,14 @@ func TestSetDefaults(t *testing.T) { Name: "cnt", Image: "img", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "batch"}, + {Name: "K_EXECUTION_MODE", Value: "batch"}, }, }, { Name: "cnt-ini2", Image: "img-ini2", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "something"}, + {Name: "K_EXECUTION_MODE", Value: "something"}, }, }, }, @@ -100,21 +100,21 @@ func TestSetDefaults(t *testing.T) { Name: "cnt", Image: "img", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "batch"}, + {Name: "K_EXECUTION_MODE", Value: "batch"}, }, }, { Name: "cnt2", Image: "img2", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "batch"}, + {Name: "K_EXECUTION_MODE", Value: "batch"}, }, }, { Name: "cnt3", Image: "img3", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "something"}, + {Name: "K_EXECUTION_MODE", Value: "something"}, }, }, }, diff --git a/pkg/reconciler/jobsink/jobsink_test.go b/pkg/reconciler/jobsink/jobsink_test.go index 5ee0d119f65..f44acba7bb8 100644 --- a/pkg/reconciler/jobsink/jobsink_test.go +++ b/pkg/reconciler/jobsink/jobsink_test.go @@ -264,7 +264,7 @@ func testJob(name string) *batchv1.Job { { Name: "test-container", Env: []corev1.EnvVar{ - {Name: "KNATIVE_EXECUTION_MODE", Value: "batch"}, + {Name: "K_EXECUTION_MODE", Value: "batch"}, }, }, },