Commit 7465858e authored by Hugo "ThePooN" Denizart's avatar Hugo "ThePooN" Denizart
Browse files

fix: retain types on worker commands items

parent 67efa9df
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ items:
          image: {{ template "imagename" $ }}
          command:
          {{- range $workerConfig.command }}
          - {{ . }}
          - {{ toYaml . }}
          {{- end }}
          imagePullPolicy: {{ $.Values.image.pullPolicy }}
          {{- if $.Values.application.secretName }}
@@ -150,7 +150,7 @@ items:
              exec:
                command:
                {{- range $workerConfig.preStopCommand }}
                - {{ . }}
                - {{ toYaml . }}
                {{- end }}
            {{- end}}
          {{- end }}
+23 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ func TestWorkerDeploymentTemplate(t *testing.T) {
		CaseName string
		Release  string
		Values   map[string]string
		StrValues   map[string]string

		ExpectedErrorRegexp *regexp.Regexp

@@ -50,6 +51,27 @@ func TestWorkerDeploymentTemplate(t *testing.T) {
					ExpectedStrategyType: appsV1.DeploymentStrategyType(""),
				},
			},
		}, {
			CaseName: "handle-numbers",
			Release:  "production",
			StrValues: map[string]string{
				"workers.worker1.command[0]": "echo",
				"workers.worker1.command[1]": "1",
				"workers.worker2.command[0]": "echo",
				"workers.worker2.command[1]": "2",
			},
			ExpectedName:    "production",
			ExpectedRelease: "production",
			ExpectedDeployments: []workerDeploymentTestCase{
				{
					ExpectedName:         "production-worker1",
					ExpectedCmd:          []string{"echo", "1"},
				},
				{
					ExpectedName:         "production-worker2",
					ExpectedCmd:          []string{"echo", "2"},
				},
			},
		}, {
			// See https://github.com/helm/helm/issues/6006
			CaseName: "long release name",
@@ -200,6 +222,7 @@ func TestWorkerDeploymentTemplate(t *testing.T) {

			options := &helm.Options{
				SetValues:      values,
				SetStrValues:   tc.StrValues,
				KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
			}