Loading assets/auto-deploy-app/Chart.yaml +1 −1 Original line number Diff line number Diff line apiVersion: v1 description: GitLab's Auto-deploy Helm Chart name: auto-deploy-app version: 2.0.1 version: 2.0.2 icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png assets/auto-deploy-app/templates/ingress.yaml +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ metadata: {{- if .Values.ingress.annotations }} {{ toYaml .Values.ingress.annotations | indent 4 }} {{- end }} {{- if .Values.ingress.tls.enabled }} kubernetes.io/tls-acme: "true" {{- end }} {{- if eq .Values.application.track "canary" }} nginx.ingress.kubernetes.io/canary: "true" nginx.ingress.kubernetes.io/canary-by-header: "canary" Loading assets/auto-deploy-app/test/template_test.go +46 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ import ( ) const ( chartName = "auto-deploy-app-2.0.1" chartName = "auto-deploy-app-2.0.2" helmChartPath = ".." ) Loading Loading @@ -853,6 +853,51 @@ func TestIngressTemplate_DifferentTracks(t *testing.T) { } } func TestIngressTemplate_TLS(t *testing.T) { templates := []string{"templates/ingress.yaml"} releaseName := "ingress-tls-test" tcs := []struct { name string values map[string]string expectedAnnotations map[string]string expectedIngressTLS []extensions.IngressTLS expectedErrorRegexp *regexp.Regexp }{ { name: "defaults", expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx", "kubernetes.io/tls-acme": "true"}, expectedIngressTLS: []extensions.IngressTLS{ extensions.IngressTLS{ Hosts: []string{"my.host.com"}, SecretName: releaseName + "-auto-deploy-tls", }, }, }, { name: "with tls disabled", values: map[string]string{"ingress.tls.enabled": "false"}, expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx"}, expectedIngressTLS: []extensions.IngressTLS(nil), }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { output, ret := renderTemplate(t, tc.values, releaseName, templates, tc.expectedErrorRegexp) if ret == false { return } ingress := new(extensions.Ingress) helm.UnmarshalK8SYaml(t, output, ingress) require.Equal(t, tc.expectedAnnotations, ingress.ObjectMeta.Annotations) require.Equal(t, tc.expectedIngressTLS, ingress.Spec.TLS) }) } } func TestIngressTemplate_Disable(t *testing.T) { templates := []string{"templates/ingress.yaml"} releaseName := "ingress-disable-test" Loading assets/auto-deploy-app/values.yaml +0 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ ingress: enabled: true secretName: "" annotations: kubernetes.io/tls-acme: "true" kubernetes.io/ingress.class: "nginx" modSecurity: enabled: false Loading Loading
assets/auto-deploy-app/Chart.yaml +1 −1 Original line number Diff line number Diff line apiVersion: v1 description: GitLab's Auto-deploy Helm Chart name: auto-deploy-app version: 2.0.1 version: 2.0.2 icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
assets/auto-deploy-app/templates/ingress.yaml +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ metadata: {{- if .Values.ingress.annotations }} {{ toYaml .Values.ingress.annotations | indent 4 }} {{- end }} {{- if .Values.ingress.tls.enabled }} kubernetes.io/tls-acme: "true" {{- end }} {{- if eq .Values.application.track "canary" }} nginx.ingress.kubernetes.io/canary: "true" nginx.ingress.kubernetes.io/canary-by-header: "canary" Loading
assets/auto-deploy-app/test/template_test.go +46 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ import ( ) const ( chartName = "auto-deploy-app-2.0.1" chartName = "auto-deploy-app-2.0.2" helmChartPath = ".." ) Loading Loading @@ -853,6 +853,51 @@ func TestIngressTemplate_DifferentTracks(t *testing.T) { } } func TestIngressTemplate_TLS(t *testing.T) { templates := []string{"templates/ingress.yaml"} releaseName := "ingress-tls-test" tcs := []struct { name string values map[string]string expectedAnnotations map[string]string expectedIngressTLS []extensions.IngressTLS expectedErrorRegexp *regexp.Regexp }{ { name: "defaults", expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx", "kubernetes.io/tls-acme": "true"}, expectedIngressTLS: []extensions.IngressTLS{ extensions.IngressTLS{ Hosts: []string{"my.host.com"}, SecretName: releaseName + "-auto-deploy-tls", }, }, }, { name: "with tls disabled", values: map[string]string{"ingress.tls.enabled": "false"}, expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx"}, expectedIngressTLS: []extensions.IngressTLS(nil), }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { output, ret := renderTemplate(t, tc.values, releaseName, templates, tc.expectedErrorRegexp) if ret == false { return } ingress := new(extensions.Ingress) helm.UnmarshalK8SYaml(t, output, ingress) require.Equal(t, tc.expectedAnnotations, ingress.ObjectMeta.Annotations) require.Equal(t, tc.expectedIngressTLS, ingress.Spec.TLS) }) } } func TestIngressTemplate_Disable(t *testing.T) { templates := []string{"templates/ingress.yaml"} releaseName := "ingress-disable-test" Loading
assets/auto-deploy-app/values.yaml +0 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ ingress: enabled: true secretName: "" annotations: kubernetes.io/tls-acme: "true" kubernetes.io/ingress.class: "nginx" modSecurity: enabled: false Loading