Commit 7bb6dd11 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason Committed by Shinya Maeda
Browse files

feat: use spec.ingressClassName when possible

parent 88e7d026
Loading
Loading
Loading
Loading
+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.25.0
version: 2.26.0
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
| service.extraPorts.protocol | Protocol of the service port definition | `nil` |
| service.extraPorts.name | Name of the service port definition | `nil` |
| ingress.enabled               | If true, enables ingress | `true`                |
| ingress.className             | The name of the ingress class to use | `nginx`                |
| ingress.path                  | Default path for the ingress | `/` |
| ingress.tls.enabled           | If true, enables SSL | `true`                    |
| ingress.tls.acme              | Controls `kubernetes.io/tls-acme` annotation | `true` |
+6 −0
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ metadata:
  labels:
{{ include "sharedlabels" . | indent 4 }}
  annotations:
{{- if not (.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
    kubernetes.io/ingress.class: {{ .Values.ingress.className | quote }}
{{- end }}
{{- if .Values.ingress.annotations }}
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
@@ -43,6 +46,9 @@ metadata:

{{- end }}
spec:
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
  ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
{{- if .Values.ingress.tls.enabled }}
  tls:
  - hosts:
+3 −0
Original line number Diff line number Diff line
@@ -347,6 +347,8 @@ func TestIngressTemplate_NetworkingV1(t *testing.T) {
	ingress := new(networkingv1.Ingress)
	helm.UnmarshalK8SYaml(t, output, ingress)
	require.Equal(t, "networking.k8s.io/v1", ingress.APIVersion)
	require.Equal(t, "nginx", *ingress.Spec.IngressClassName)
	require.NotContains(t, "kubernetes.io/ingress.class", ingress.Annotations)
}

func TestIngressTemplate_Extensions(t *testing.T) {
@@ -359,4 +361,5 @@ func TestIngressTemplate_Extensions(t *testing.T) {
	ingress := new(extensions.Ingress)
	helm.UnmarshalK8SYaml(t, output, ingress)
	require.Equal(t, "extensions/v1beta1", ingress.APIVersion)
	require.Equal(t, "nginx", ingress.Annotations["kubernetes.io/ingress.class"])
}
+1 −2
Original line number Diff line number Diff line
@@ -80,8 +80,7 @@ ingress:
    acme: true
    secretName: ""
    useDefaultSecret: false
  annotations:
    kubernetes.io/ingress.class: "nginx"
  className: nginx
  modSecurity:
    enabled: false
    secRuleEngine: "DetectionOnly"