suite: deployment template (image configuration) release: name: gitea-unittests namespace: testing chart: # Override appVersion to be consistent with used digest :) appVersion: 1.19.3 templates: - templates/deployment.yaml - templates/secret_admin.yaml - templates/secret_config.yaml - templates/secret_gpg.yaml - templates/secret_init.yaml - templates/secret_inlineConfig.yaml - templates/secret_metrics.yaml tests: - it: "Render the default image reference" template: templates/deployment.yaml asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3-rootless" - it: "Render a custom image tag" template: templates/deployment.yaml set: deployment.gitea.image.tag: "1.19.4" asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.4-rootless" - it: "Render the root-based image variant" template: templates/deployment.yaml set: deployment.gitea.image.rootless: false asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3" - it: "Render a scoped image registry" template: templates/deployment.yaml set: deployment.gitea.image.registry: "example.com" asserts: - equal: path: spec.template.spec.containers[0].image value: "example.com/gitea:1.19.3-rootless" - it: "Render the global image registry" template: templates/deployment.yaml set: global.imageRegistry: "global.example.com" asserts: - equal: path: spec.template.spec.containers[0].image value: "global.example.com/gitea:1.19.3-rootless" - it: "Render a digest for the rootless image" template: templates/deployment.yaml set: deployment: gitea: image: rootless: true digest: sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" - it: "Render image.fullOverride without appending the rootless suffix" template: templates/deployment.yaml set: deployment: gitea: image: fullOverride: docker.gitea.com/gitea:1.19.3 # setting rootless, registry, repository, tag, and digest to prove that override works rootless: true registry: example.com repository: example/image tag: "1.0.0" digest: sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3" - it: "Render a digest for the root-based image" template: templates/deployment.yaml set: deployment: gitea: image: rootless: false digest: sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a asserts: - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" - it: "Render a digest together with the global image registry" template: templates/deployment.yaml set: global.imageRegistry: "global.example.com" deployment.gitea.image.digest: "sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" asserts: - equal: path: spec.template.spec.containers[0].image value: "global.example.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" - it: "Render unquoted floating tag references" template: templates/deployment.yaml set: # use non-quoted values on purpose. See: https://gitea.com/gitea/helm-gitea/issues/631 deployment.gitea.image.tag: 1.21 deployment.initDirectories.image.tag: 1.21 deployment.initAppIni.image.tag: 1.21 deployment.initConfigureGitea.image.tag: 1.21 asserts: - equal: path: spec.template.spec.initContainers[0].image value: "docker.gitea.com/gitea:1.21-rootless" - equal: path: spec.template.spec.initContainers[1].image value: "docker.gitea.com/gitea:1.21-rootless" - equal: path: spec.template.spec.initContainers[2].image value: "docker.gitea.com/gitea:1.21-rootless" - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.21-rootless" - it: "Render the own image configuration of the init containers" template: templates/deployment.yaml set: deployment.initDirectories.image.registry: "init.example.com" deployment.initDirectories.image.tag: "1.19.4" asserts: - equal: path: spec.template.spec.initContainers[0].image value: "init.example.com/gitea:1.19.4-rootless" - equal: path: spec.template.spec.initContainers[1].image value: "docker.gitea.com/gitea:1.19.3-rootless" - equal: path: spec.template.spec.containers[0].image value: "docker.gitea.com/gitea:1.19.3-rootless"