Skip to content

Commit

Permalink
OPSEXP-2188: missing ingress class in share (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz authored Jul 19, 2023
1 parent 6929d97 commit c9ad65a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/alfresco-share/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/alfresco-share/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions charts/alfresco-share/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
15 changes: 14 additions & 1 deletion charts/alfresco-share/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c9ad65a

Please sign in to comment.