From b1b9b5b9f70ff0b506eee05622519e5366263b96 Mon Sep 17 00:00:00 2001 From: Jonathan Hess Date: Tue, 3 Oct 2023 14:47:44 -0600 Subject: [PATCH] fix: Correct the name of the quit url envvar CSQL_PROXY_QUIT_URLS. --- internal/testhelpers/resources.go | 4 ++-- internal/workload/podspec_updates.go | 2 +- internal/workload/podspec_updates_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/testhelpers/resources.go b/internal/testhelpers/resources.go index b4b18e15..3ff18b43 100644 --- a/internal/testhelpers/resources.go +++ b/internal/testhelpers/resources.go @@ -297,7 +297,7 @@ func BuildJob(name types.NamespacedName, appLabel string) *batchv1.Job { job.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyNever podCmd := fmt.Sprintf("echo Container 1 is Running \n"+ "sleep %d \n"+ - "for url in $CSQL_QUIT_URLS ; do \n"+ + "for url in $CSQL_PROXY_QUIT_URLS ; do \n"+ " wget --post-data '' $url \n"+ "done", 30) job.Spec.Template.Spec.Containers[0].Command = []string{"sh", "-c", podCmd} @@ -331,7 +331,7 @@ func BuildCronJob(name types.NamespacedName, appLabel string) *batchv1.CronJob { job.Spec.JobTemplate.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyNever podCmd := fmt.Sprintf("echo Container 1 is Running \n"+ "sleep %d \n"+ - "for url in $CSQL_QUIT_URLS ; do \n"+ + "for url in $CSQL_PROXY_QUIT_URLS ; do \n"+ " wget --post-data '' $url \n"+ "done", 30) job.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Command = []string{"sh", "-c", podCmd} diff --git a/internal/workload/podspec_updates.go b/internal/workload/podspec_updates.go index 16a6e5f8..b8d6a237 100644 --- a/internal/workload/podspec_updates.go +++ b/internal/workload/podspec_updates.go @@ -408,7 +408,7 @@ func (s *updateState) addQuitEnvVar() { s.addEnvVar(nil, managedEnvVar{ OperatorManagedValue: corev1.EnvVar{ - Name: "CSQL_QUIT_URLS", + Name: "CSQL_PROXY_QUIT_URLS", Value: v, }}) } diff --git a/internal/workload/podspec_updates_test.go b/internal/workload/podspec_updates_test.go index 30a2e268..937332c0 100644 --- a/internal/workload/podspec_updates_test.go +++ b/internal/workload/podspec_updates_test.go @@ -1015,7 +1015,7 @@ func TestQuitURLEnvVar(t *testing.T) { } // test that envvar was set - ev, err := findEnvVar(wl, "busybox", "CSQL_QUIT_URLS") + ev, err := findEnvVar(wl, "busybox", "CSQL_PROXY_QUIT_URLS") if err != nil { t.Fatal("can't find env var", err) }