Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart: Extend image tests. #12027

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions charts/ingress-nginx/tests/controller-daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,34 @@ tests:
- controller
topologyKey: kubernetes.io/hostname

- it: should create a DaemonSet with a custom registry if `controller.image.registry` is set
set:
controller.kind: DaemonSet
controller.image.registry: custom.registry.io
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
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: my-little-custom-tag
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:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
value: registry.k8s.io/ingress-nginx/controller:custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
24 changes: 22 additions & 2 deletions charts/ingress-nginx/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,31 @@ tests:
- controller
topologyKey: kubernetes.io/hostname

- it: should create a Deployment with a custom registry if `controller.image.registry` is set
set:
controller.image.registry: custom.registry.io
controller.image.tag: v1.0.0-dev
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
asserts:
- equal:
path: spec.template.spec.containers[0].image
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: my-little-custom-tag
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:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
value: registry.k8s.io/ingress-nginx/controller:custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
32 changes: 32 additions & 0 deletions charts/ingress-nginx/tests/default-backend-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,35 @@ tests:
values:
- default-backend
topologyKey: kubernetes.io/hostname

- 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