diff --git a/charts/alfresco-share/Chart.yaml b/charts/alfresco-share/Chart.yaml index 0db72e31..a8e958ff 100644 --- a/charts/alfresco-share/Chart.yaml +++ b/charts/alfresco-share/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: alfresco-share description: Alfresco Share Helm chart for Kubernetes type: application -version: 0.1.0-alpha.1 +version: 0.1.0-alpha.2 appVersion: 7.4.0 dependencies: - repository: https://alfresco.github.io/alfresco-helm-charts diff --git a/charts/alfresco-share/README.md b/charts/alfresco-share/README.md index 25fd32d8..3a05e149 100644 --- a/charts/alfresco-share/README.md +++ b/charts/alfresco-share/README.md @@ -1,6 +1,6 @@ # alfresco-share -![Version: 0.1.0-alpha.1](https://img.shields.io/badge/Version-0.1.0--alpha.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.4.0](https://img.shields.io/badge/AppVersion-7.4.0-informational?style=flat-square) +![Version: 0.1.0-alpha.2](https://img.shields.io/badge/Version-0.1.0--alpha.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.4.0](https://img.shields.io/badge/AppVersion-7.4.0-informational?style=flat-square) Alfresco Share Helm chart for Kubernetes diff --git a/charts/alfresco-share/templates/ingress.yaml b/charts/alfresco-share/templates/ingress.yaml index 2cbdae34..60afc986 100644 --- a/charts/alfresco-share/templates/ingress.yaml +++ b/charts/alfresco-share/templates/ingress.yaml @@ -6,8 +6,7 @@ We only support nginx ingress for now: https://alfresco.atlassian.net/browse/OPS */}} {{- if not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} {{- $_ := unset .Values.ingress.annotations "kubernetes.io/ingress.class" }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" "nginx" }} -*/}} + {{- $_ = set .Values.ingress.annotations "kubernetes.io/ingress.class" "nginx" }} {{- end }} {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 @@ -29,7 +28,7 @@ spec: {{/* We only support nginx ingress for now: https://alfresco.atlassian.net/browse/OPSEXP-131 */}} - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + {{- if (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: nginx {{- end }} {{- if .Values.ingress.tls }} diff --git a/charts/alfresco-share/tests/ingress_test.yaml b/charts/alfresco-share/tests/ingress_test.yaml index 2b1e75d8..41f57782 100644 --- a/charts/alfresco-share/tests/ingress_test.yaml +++ b/charts/alfresco-share/tests/ingress_test.yaml @@ -13,13 +13,26 @@ tests: location ~ ^/.*/-default-/proxy/.*/api/.*$ {return 403;} location ~ ^/.*/s/prometheus$ {return 403;} template: ingress.yaml - - it: should trim out any custom server-snippet + - equal: + path: spec.ingressClassName + value: nginx + template: ingress.yaml + + - it: should sanitize ingress + capabilities: + majorVersion: 1 + minorVersion: 17 set: ingress: annotations: + kubernetes.io/ingress.class: myfancyClass nginx.ingress.kubernetes.io/server-snippet: listen 6666; asserts: - notMatchRegex: path: metadata.annotations['nginx.ingress.kubernetes.io/server-snippet'] pattern: listen 6666; template: ingress.yaml + - equal: + path: metadata.annotations['kubernetes.io/ingress.class'] + value: nginx + template: ingress.yaml