feat(common): Release common v4.1.0 (#416)

This commit is contained in:
Bernd Schorgers 2025-06-11 16:09:46 +02:00 committed by GitHub
parent f3660654f4
commit db552e2dee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 705 additions and 129 deletions

View file

@ -54,3 +54,15 @@ tests:
- equal:
path: spec.template.spec.serviceAccountName
value: mySA3
- it: with automatic serviceAccount detection should pass
set:
serviceAccount:
mySA: {}
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: mySA

View file

@ -72,3 +72,29 @@ tests:
labelSelector:
matchLabels:
app: foo
- it: topologySpreadConstraints with template should pass
set:
controllers:
main:
pod:
topologySpreadConstraints:
- maxSkew: 2
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: "{{ .Release.Name }}"
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- equal:
path: spec.template.spec.topologySpreadConstraints
value:
- maxSkew: 2
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: RELEASE-NAME

View file

@ -0,0 +1,16 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: service - validations
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: automatic Service Account determination should fail when >1 Service Account is enabled
set:
serviceAccount:
mySA: {}
mySA2: {}
asserts:
- failedTemplate:
errorMessage: "serviceAccount field is required because automatic Service Account detection is not possible. (controller: main)"