deprecate ingress.className in favor of ingress.ingressClassName
This commit is contained in:
parent
f34fe9efb9
commit
52a779f26c
19
README.md
19
README.md
@ -905,15 +905,16 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
|||||||
|
|
||||||
### Ingress
|
### Ingress
|
||||||
|
|
||||||
| Name | Description | Value |
|
| Name | Description | Value |
|
||||||
| ------------------------ | -------------------- | ----------------- |
|
| -------------------------- | -------------------- | ----------------- |
|
||||||
| `ingress.enabled` | Enable ingress | `false` |
|
| `ingress.enabled` | Enable ingress | `false` |
|
||||||
| `ingress.className` | Ingress class name | `nil` |
|
| `ingress.className` | Ingress class name | `""` |
|
||||||
| `ingress.pathType` | Ingress Path Type | `Prefix` |
|
| `ingress.ingressClassName` | Ingress class name | `""` |
|
||||||
| `ingress.annotations` | Ingress annotations | `{}` |
|
| `ingress.pathType` | Ingress Path Type | `Prefix` |
|
||||||
| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` |
|
| `ingress.annotations` | Ingress annotations | `{}` |
|
||||||
| `ingress.hosts[0].paths` | Default Ingress path | `[]` |
|
| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` |
|
||||||
| `ingress.tls` | Ingress tls settings | `[]` |
|
| `ingress.hosts[0].paths` | Default Ingress path | `[]` |
|
||||||
|
| `ingress.tls` | Ingress tls settings | `[]` |
|
||||||
|
|
||||||
### deployment
|
### deployment
|
||||||
|
|
||||||
|
@ -403,4 +403,16 @@ https
|
|||||||
{{- toYaml .Values.ingress.annotations | nindent 4 }}
|
{{- toYaml .Values.ingress.annotations | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Deprecations */ -}}
|
||||||
|
{{- /* 10.4.0 (2024-07) */ -}}
|
||||||
|
{{- define "deprecations" -}}
|
||||||
|
{{- if ne .Values.ingress.className "" }}
|
||||||
|
{{- printf "# WARNING: 'ingress.className' is deprecated and will be removed in a future release. Use 'ingress.ingressClassName' instead.\n" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and (ne .Values.ingress.className "" ) (ne .Values.ingress.ingressClassName "") -}}
|
||||||
|
{{- fail "ingress.ingressClassName and ingress.className cannot be defined at the same time. Please only choose one." -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
@ -1,3 +1,4 @@
|
|||||||
|
{{- include "deprecations" . -}}
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "gitea.fullname" . -}}
|
{{- $fullName := include "gitea.fullname" . -}}
|
||||||
{{- $httpPort := .Values.service.http.port -}}
|
{{- $httpPort := .Values.service.http.port -}}
|
||||||
@ -10,8 +11,10 @@ metadata:
|
|||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
{{- template "ingress.annotations" . }}
|
{{- template "ingress.annotations" . }}
|
||||||
spec:
|
spec:
|
||||||
{{- if .Values.ingress.className }}
|
{{- if ne .Values.ingress.className "" }}
|
||||||
ingressClassName: {{ tpl .Values.ingress.className . }}
|
ingressClassName: {{ tpl .Values.ingress.className . }}
|
||||||
|
{{- else }}
|
||||||
|
ingressClassName: {{ tpl .Values.ingress.ingressClassName . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.ingress.tls }}
|
{{- if .Values.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
|
@ -53,7 +53,7 @@ tests:
|
|||||||
- it: Ingress Class using TPL
|
- it: Ingress Class using TPL
|
||||||
set:
|
set:
|
||||||
global.ingress.className: "ingress-class"
|
global.ingress.className: "ingress-class"
|
||||||
ingress.className: "{{ .Values.global.ingress.className }}"
|
ingress.ingressClassName: "{{ .Values.global.ingress.className }}"
|
||||||
ingress.enabled: true
|
ingress.enabled: true
|
||||||
ingress.hosts[0].host: "some-host"
|
ingress.hosts[0].host: "some-host"
|
||||||
ingress.tls:
|
ingress.tls:
|
||||||
|
43
unittests/ingress/deprecations.yaml
Normal file
43
unittests/ingress/deprecations.yaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
suite: Test ingress.yaml
|
||||||
|
templates:
|
||||||
|
- templates/gitea/ingress.yaml
|
||||||
|
tests:
|
||||||
|
- it: should fail when both ingress.className and ingress.ingressClassName are defined
|
||||||
|
set:
|
||||||
|
ingress.enabled: true
|
||||||
|
ingress.className: "ingress-class"
|
||||||
|
ingress.ingressClassName: "ingress-class"
|
||||||
|
asserts:
|
||||||
|
- failedTemplate:
|
||||||
|
errorMessage: "ingress.ingressClassName and ingress.className cannot be defined at the same time. Please only choose one."
|
||||||
|
|
||||||
|
- it: should succeed when only ingress.className is defined
|
||||||
|
set:
|
||||||
|
ingress.enabled: true
|
||||||
|
ingress.ingressClassName: "ingress-class"
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
|
||||||
|
- it: should succeed when only ingress.ingressClassName is defined
|
||||||
|
set:
|
||||||
|
ingress.enabled: true
|
||||||
|
ingress.ingressClassName: "ingress-class"
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- equal:
|
||||||
|
path: spec.ingressClassName
|
||||||
|
value: ingress-class
|
||||||
|
|
||||||
|
- it: should succeed when neither ingress.className nor ingress.ingressClassName are defined
|
||||||
|
set:
|
||||||
|
ingress.enabled: true
|
||||||
|
ingress.className: "ingress-class"
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- equal:
|
||||||
|
path: spec.ingressClassName
|
||||||
|
value: ingress-class
|
||||||
|
|
15
values.yaml
15
values.yaml
@ -151,6 +151,7 @@ service:
|
|||||||
## @section Ingress
|
## @section Ingress
|
||||||
## @param ingress.enabled Enable ingress
|
## @param ingress.enabled Enable ingress
|
||||||
## @param ingress.className Ingress class name
|
## @param ingress.className Ingress class name
|
||||||
|
## @param ingress.ingressClassName Ingress class name
|
||||||
## @param ingress.pathType Ingress Path Type
|
## @param ingress.pathType Ingress Path Type
|
||||||
## @param ingress.annotations Ingress annotations
|
## @param ingress.annotations Ingress annotations
|
||||||
## @param ingress.hosts[0].host Default Ingress host
|
## @param ingress.hosts[0].host Default Ingress host
|
||||||
@ -158,13 +159,12 @@ service:
|
|||||||
## @param ingress.tls Ingress tls settings
|
## @param ingress.tls Ingress tls settings
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
# className: nginx
|
# DEPRECATED: Use `ingress.ingressClassName` instead.
|
||||||
className:
|
className: ""
|
||||||
|
ingressClassName: ""
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
annotations:
|
annotations: {}
|
||||||
{}
|
# kubernetes.io/tls-acme: "true"
|
||||||
# kubernetes.io/ingress.class: nginx
|
|
||||||
# kubernetes.io/tls-acme: "true"
|
|
||||||
hosts:
|
hosts:
|
||||||
- host: git.example.com
|
- host: git.example.com
|
||||||
paths: []
|
paths: []
|
||||||
@ -172,9 +172,6 @@ ingress:
|
|||||||
# - secretName: chart-example-tls
|
# - secretName: chart-example-tls
|
||||||
# hosts:
|
# hosts:
|
||||||
# - git.example.com
|
# - git.example.com
|
||||||
# Mostly for argocd or any other CI that uses `helm template | kubectl apply` or similar
|
|
||||||
# If helm doesn't correctly detect your ingress API version you can set it here.
|
|
||||||
# apiVersion: networking.k8s.io/v1
|
|
||||||
|
|
||||||
## @section deployment
|
## @section deployment
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user