Chart: Extend image tests. (#12025)

This commit is contained in:
Marco Ebert 2024-09-28 13:03:35 +02:00 committed by GitHub
parent 7b8d293d9b
commit 24a9f972ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 80 additions and 6 deletions

View file

@ -148,12 +148,34 @@ tests:
path: spec.template.spec.containers[0].securityContext.runAsGroup path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000 value: 1000
- it: should create a DaemonSet with a custom tag if `controller.image.tag` is set - it: should create a DaemonSet with a custom registry if `controller.image.registry` is set
set: set:
controller.kind: DaemonSet controller.kind: DaemonSet
controller.image.tag: my-little-custom-tag controller.image.registry: custom.registry.io
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: registry.k8s.io/ingress-nginx/controller:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd value: custom.registry.io/ingress-nginx/controller:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a DaemonSet with a custom image if `controller.image.image` is set
set:
controller.kind: DaemonSet
controller.image.image: custom-repo/custom-image
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/custom-repo/custom-image:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a DaemonSet with a custom tag if `controller.image.tag` is set
set:
controller.kind: DaemonSet
controller.image.tag: custom-tag
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/ingress-nginx/controller:custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd

View file

@ -169,14 +169,34 @@ tests:
path: spec.template.spec.containers[0].securityContext.runAsGroup path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000 value: 1000
- it: should create a Deployment with a custom tag if `controller.image.tag` is set - it: should create a Deployment with a custom registry if `controller.image.registry` is set
set: set:
controller.image.tag: my-little-custom-tag controller.image.registry: custom.registry.io
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: registry.k8s.io/ingress-nginx/controller:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd value: custom.registry.io/ingress-nginx/controller:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a Deployment with a custom image if `controller.image.image` is set
set:
controller.image.image: custom-repo/custom-image
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/custom-repo/custom-image:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a Deployment with a custom tag if `controller.image.tag` is set
set:
controller.image.tag: custom-tag
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/ingress-nginx/controller:custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a Deployment with `progressDeadlineSeconds` if `controller.progressDeadlineSeconds` is set - it: should create a Deployment with `progressDeadlineSeconds` if `controller.progressDeadlineSeconds` is set
set: set:

View file

@ -144,3 +144,35 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].securityContext.runAsGroup path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000 value: 1000
- it: should create a Deployment with a custom registry if `defaultBackend.image.registry` is set
set:
defaultBackend.enabled: true
defaultBackend.image.registry: custom.registry.io
defaultBackend.image.tag: v1.0.0-dev
defaultBackend.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: custom.registry.io/defaultbackend-amd64:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a Deployment with a custom image if `defaultBackend.image.image` is set
set:
defaultBackend.enabled: true
defaultBackend.image.image: custom-repo/custom-image
defaultBackend.image.tag: v1.0.0-dev
defaultBackend.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/custom-repo/custom-image:v1.0.0-dev@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
- it: should create a Deployment with a custom tag if `defaultBackend.image.tag` is set
set:
defaultBackend.enabled: true
defaultBackend.image.tag: custom-tag
defaultBackend.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.k8s.io/defaultbackend-amd64:custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd