diff --git a/charts/unit/helpers.go b/charts/unit/helpers.go index cbc39b7a..f881a147 100644 --- a/charts/unit/helpers.go +++ b/charts/unit/helpers.go @@ -38,7 +38,7 @@ func renderServiceAccountManifest(t *testing.T, options *helm.Options) corev1.Se output, err := helm.RenderTemplateE(t, options, helmChartPath, helmReleaseName, []string{serviceAccountTemplate}) assert.NoError(t, err) - var sa corev1.ServiceAccount + sa := corev1.ServiceAccount{} helm.UnmarshalK8SYaml(t, output, &sa) return sa } diff --git a/charts/unit/service_account_test.go b/charts/unit/service_account_test.go index f00e0faa..7547014f 100644 --- a/charts/unit/service_account_test.go +++ b/charts/unit/service_account_test.go @@ -34,7 +34,7 @@ func TestControllerServiceAccountCreateFalse(t *testing.T) { Version: helmChartVersion, } - _, err := helm.RenderTemplateE(t, options, helmChartPath, helmReleaseName, []string{"templates/serviceaccount.yaml"}) + _, err := helm.RenderTemplateE(t, options, helmChartPath, helmReleaseName, []string{serviceAccountTemplate}) assert.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("could not find template %s in chart", serviceAccountTemplate)) } @@ -60,7 +60,6 @@ func TestControllerServiceAccountAnnotations(t *testing.T) { assert.Equal(t, defaultNamespace, sa.Namespace) } -// FINISH func TestControllerServiceAccountNamespace(t *testing.T) { ns := "this" options := &helm.Options{