feat(common)!: Release v3.0.0-beta1 (#278)

This commit is contained in:
Bernd Schorgers 2024-03-07 19:53:41 +01:00 committed by GitHub
parent deafcf75a1
commit b78483b0b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 3697 additions and 1209 deletions

View file

@ -39,7 +39,7 @@ tests:
equal:
path: spec.template.spec.containers[0].args
value:
- |
- |-
echo hello
echo world

View file

@ -39,7 +39,7 @@ tests:
equal:
path: spec.template.spec.containers[0].command
value:
- |
- |-
/bin/sh
-c

View file

@ -94,6 +94,25 @@ tests:
fieldRef:
fieldPath: spec.nodeName
- it: Implicit ValueFrom in list should pass
set:
controllers.main.containers.main.env:
- name: DYNAMIC_ENV_FROM_LIST
fieldRef:
fieldPath: spec.nodeName
asserts:
- documentIndex: &DeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *DeploymentDoc
equal:
path: spec.template.spec.containers[0].env[0]
value:
name: DYNAMIC_ENV_FROM_LIST
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- it: Implicit ValueFrom should pass
set:
controllers.main.containers.main.env:

View file

@ -46,6 +46,10 @@ tests:
prefix: test
- configMapRef:
identifier: config
configMaps:
config:
data:
test: test
asserts:
- documentIndex: &DeploymentDoc 0
isKind:
@ -72,6 +76,10 @@ tests:
- secretRef:
identifier: secret
prefix: test
secrets:
secret:
stringData:
test: test
asserts:
- documentIndex: &DeploymentDoc 0
isKind:

View file

@ -0,0 +1,29 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: container restartPolicy
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
notExists:
path: spec.template.spec.containers[0].restartPolicy
- it: custom restartPolicy should pass
set:
controllers.main.containers:
main:
restartPolicy: Always
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].restartPolicy
value: Always

View file

@ -9,7 +9,6 @@ tests:
controllers.main.containers:
main:
nameOverride: template-test
controller: main
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:
@ -25,7 +24,6 @@ tests:
set:
controllers.main.containers:
main:
controller: main
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:
@ -42,7 +40,6 @@ tests:
controllers.main.containers:
main:
nameOverride: "{{ .Release.Name }}-container"
controller: main
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:

View file

@ -3,6 +3,12 @@
suite: container probes
templates:
- common.yaml
set:
controllers.main.containers.main.probes.liveness.enabled: true
controllers.main.containers.main.probes.readiness.enabled: true
controllers.main.containers.main.probes.startup.enabled: true
tests:
- it: default should pass
set:
@ -40,9 +46,9 @@ tests:
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 5
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
@ -87,9 +93,9 @@ tests:
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 5
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
@ -130,9 +136,9 @@ tests:
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 5
periodSeconds: 10
tcpSocket:
port: 80
timeoutSeconds: 1
@ -162,6 +168,7 @@ tests:
main:
ports:
http:
protocol: HTTP
port: &port 80
controllers.main.containers.main.probes:
@ -462,9 +469,9 @@ tests:
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 5
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1

View file

@ -4,17 +4,6 @@ suite: Container validations
templates:
- common.yaml
tests:
- it: image required to be a dictionary
set:
controllers:
main:
containers:
test:
image: "test:latest"
asserts:
- failedTemplate:
errorMessage: "Image required to be a dictionary with repository and tag fields. (controller main, container test)"
- it: image repository is required
set:
controllers:

View file

@ -17,7 +17,8 @@ tests:
set:
persistence:
config:
enabled: true
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- documentIndex: &DeploymentDoc 1
isKind:
@ -123,7 +124,6 @@ tests:
set:
persistence:
config:
enabled: true
accessMode: ReadWriteMany
size: 1G
globalMounts:
@ -143,7 +143,6 @@ tests:
set:
persistence:
config:
enabled: true
existingClaim: myClaim
globalMounts:
- path: /config
@ -164,7 +163,6 @@ tests:
set:
persistence:
config:
enabled: true
type: hostPath
hostPath: /tmp
globalMounts:
@ -184,7 +182,6 @@ tests:
set:
persistence:
config:
enabled: true
type: hostPath
hostPath: /dev
globalMounts: