mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common v4.1.0 (#416)
This commit is contained in:
parent
f3660654f4
commit
db552e2dee
52 changed files with 705 additions and 129 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)"
|
Loading…
Add table
Add a link
Reference in a new issue