123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- suite: container image test
- templates:
- - common.yaml
- tests:
- - it: should generate correct image
- set:
- imageDictToUse: image
- image: &image
- repository: nginx
- tag: "1.19.0"
- pullPolicy: IfNotPresent
- imageGPU:
- repository: some-gpu-image
- tag: "5.20"
- pullPolicy: Always
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: "{{ .Values.imageDictToUse }}"
- probes: &probes
- liveness:
- enabled: false
- readiness:
- enabled: false
- startup:
- enabled: false
- container-name2:
- enabled: true
- primary: false
- imageSelector: imageGPU
- probes: *probes
- asserts:
- - documentIndex: &deploymentDoc 0
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- isAPIVersion:
- of: apps/v1
- - documentIndex: *deploymentDoc
- isSubset:
- path: spec.template.spec.containers[0]
- content:
- image: nginx:1.19.0
- imagePullPolicy: IfNotPresent
- - documentIndex: *deploymentDoc
- isSubset:
- path: spec.template.spec.containers[1]
- content:
- image: some-gpu-image:5.20
- imagePullPolicy: Always
- # Failures
- - it: should fail with imageSelector trying to access non-existent image
- set:
- image: *image
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image-dict-that-does-not-exist
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <.Values.image-dict-that-does-not-exist> to exist
- - it: should fail with empty repository in selected image
- set:
- image:
- repository: ""
- tag: 1.19.0
- pullPolicy: IfNotPresent
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <.Values.image.repository>
- - it: should fail with empty tag in selected image
- set:
- image:
- repository: nginx
- tag: ""
- pullPolicy: IfNotPresent
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <.Values.image.tag>
- - it: should fail with invalid pullPolicy selected image
- set:
- image:
- repository: nginx
- tag: "1.19.0"
- pullPolicy: invalid
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <.Values.image.pullPolicy> to be one of [IfNotPresent, Always, Never], but got [invalid]
- - it: should fail with tag not string on selected image
- set:
- image:
- repository: nginx
- tag: 1.19
- pullPolicy: invalid
- workload:
- workload-name:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <.Values.image.tag> to be string, but got [float64]
|