Files
helm-gitea/unittests/helm/ingress/ingress.yaml
T
volker.raschekandCopilot 61d04282c8 feat(ingress)!: rename className to ingressClassName
The value only ever populated the `spec.ingressClassName` field of the Ingress resource, so the shortened name was a
needless deviation from the Kubernetes API. `ingress.className` carried a `DEPRECATED` marker since #679, but that
marker was a leftover: the rename to the canonical name was proposed there, rejected during review and the follow-up
commits only removed the half-merged template fallback. The marker stayed behind for a year while the value remained
the one and only way to set the Ingress class, which made the documentation actively misleading.

The deprecation guard uses `hasKey` instead of a truthiness check on purpose. The previous chart default was an empty
string, so vendored values files tend to carry `ingress.className: ""` verbatim. A truthiness check would silently
ignore those and leave users wondering why their Ingress class is no longer applied.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 18:43:05 +02:00

156 lines
3.9 KiB
YAML

chart:
appVersion: 1.27.3
release:
name: gitea-unittests
namespace: testing
suite: Test ingress.yaml
templates:
- templates/ingress.yaml
tests:
- it: Skip ingress if ingress is disabled
set:
ingress.enabled: false
service.http.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Skip ingress if HTTP Service is disabled
set:
ingress.enabled: true
service.http.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Skip ingress if both ingress and HTTP Service are disabled
set:
ingress.enabled: false
service.http.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Render ingress with default values
set:
ingress.enabled: true
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- notExists:
path: metadata.annotations
- isSubset:
path: metadata.labels
content:
app: gitea
app.kubernetes.io/instance: gitea-unittests
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: gitea
app.kubernetes.io/version: 1.27.3
helm.sh/chart: gitea-0.0.0
version: 1.27.3
- equal:
path: spec.ingressClassName
value: nginx
- contains:
path: spec.rules
content:
host: git.example.com
http:
paths:
- backend:
service:
name: gitea-unittests-http
port:
number: 3000
path: /
pathType: Prefix
- it: Render ingress with TLS
set:
ingress.enabled: true
ingress.tls:
- hosts:
- git.example.com
secretName: tls-secret
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- contains:
path: spec.tls
content:
hosts:
- git.example.com
secretName: tls-secret
- it: Render ingress with a custom ingressClassName
set:
ingress.enabled: true
ingress.ingressClassName: traefik
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.ingressClassName
value: traefik
- it: Render ingress with custom HTTP service spec
set:
ingress.enabled: true
service.http.enabled: true
service.http.port: 32000
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- contains:
path: spec.rules
content:
host: git.example.com
http:
paths:
- backend:
service:
name: gitea-unittests-http
port:
number: 32000
path: /
pathType: Prefix
- it: Render ingress with custom annotations and labels
set:
ingress.enabled: true
ingress.annotations:
custom-annotation: custom-value
ingress.labels:
custom-label: custom-value
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- isSubset:
path: metadata.annotations
content:
custom-annotation: custom-value
- isSubset:
path: metadata.labels
content:
custom-label: custom-value