| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- suite: test controller deployment
- templates:
- - deployment.yaml
- tests:
- - it: should match snapshot of default values
- asserts:
- - matchSnapshot: {}
- - it: should set imagePullPolicy to Always
- set:
- image.pullPolicy: Always
- asserts:
- - equal:
- path: spec.template.spec.containers[0].imagePullPolicy
- value: Always
- - it: should imagePullPolicy to be default value IfNotPresent
- asserts:
- - equal:
- path: spec.template.spec.containers[0].imagePullPolicy
- value: IfNotPresent
- - it: should override securityContext
- set:
- podSecurityContext:
- runAsUser: 2000
- securityContext:
- runAsUser: 3000
- asserts:
- - equal:
- path: spec.template.spec.securityContext
- value:
- runAsUser: 2000
- - equal:
- path: spec.template.spec.containers[0].securityContext
- value:
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - ALL
- readOnlyRootFilesystem: true
- runAsNonRoot: true
- runAsUser: 3000
- seccompProfile:
- type: RuntimeDefault
- - it: should override hostNetwork
- set:
- hostNetwork: true
- asserts:
- - equal:
- path: spec.template.spec.hostNetwork
- value: true
- - it: should override metrics port
- set:
- metrics.listen.port: 8888
- asserts:
- - contains:
- path: spec.template.spec.containers[0].args
- content: "--metrics-addr=:8888"
- - it: should override image flavour
- set:
- image.repository: ghcr.io/external-secrets/external-secrets
- image.tag: v0.9.8
- image.flavour: ubi-boringssl
- asserts:
- - equal:
- path: spec.template.spec.containers[0].image
- value: ghcr.io/external-secrets/external-secrets:v0.9.8-ubi-boringssl
- - it: should override image flavour
- set:
- image.repository: example.com/external-secrets/external-secrets
- image.tag: v0.9.9-ubi
- asserts:
- - equal:
- path: spec.template.spec.containers[0].image
- value: example.com/external-secrets/external-secrets:v0.9.9-ubi
- - it: should add a init container
- set:
- extraInitContainers:
- - name: foo
- image: example.com/external-secrets/init-image:{{ .Chart.Version }}
- restartPolicy: Always
- asserts:
- - equal:
- path: spec.template.spec.initContainers[0].name
- value: foo
- - matchRegex:
- path: spec.template.spec.initContainers[0].image
- pattern: ^example\.com/external-secrets/init-image:[0-9]+\.[0-9]+\.[0-9]+$
- - equal:
- path: spec.template.spec.initContainers[0].restartPolicy
- value: Always
- - it: should override the deployment strategy
- set:
- strategy:
- rollingUpdate:
- maxSurge: 1
- maxUnavailable: 0
- asserts:
- - equal:
- path: spec.strategy.rollingUpdate.maxSurge
- value: 1
- - equal:
- path: spec.strategy.rollingUpdate.maxUnavailable
- value: 0
- - it: should add livenessProbe if define
- set:
- livenessProbe:
- enabled: true
- spec:
- initialDelaySeconds: 10
- periodSeconds: 10
- timeoutSeconds: 10
- failureThreshold: 10
- successThreshold: 10
- httpGet:
- path: /healthz
- port: "8080"
- scheme: HTTP
- asserts:
- - equal:
- path: spec.template.spec.containers[0].livenessProbe.httpGet.port
- value: "8080"
- - it: should update args with enableHTTP2=true
- set:
- enableHTTP2: true
- asserts:
- - contains:
- path: spec.template.spec.containers[0].args
- content: "--enable-http2=true"
- - it: should not have enableHTTP2 flag by default
- asserts:
- - notContains:
- path: spec.template.spec.containers[0].args
- content: "--enable-http2"
|