From 29c7a5fc9b296a5e8da17e01f0c2c623c0f859ef Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Mon, 20 Nov 2023 11:18:35 +0100 Subject: [PATCH] Remove support for legacy `image` field for image specifications The `image` field was deprecated in component version v6. We now remove the field, so we can do the roll out of ArgoCD v2.9 with the new Kapitan sidecar plugin which uses a different container image with as little manual configuration as possible. --- component/common.libsonnet | 7 ++++--- docs/modules/ROOT/pages/references/parameters.adoc | 1 + tests/golden/params/argocd/argocd/25_hooks/hooks.yaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/component/common.libsonnet b/component/common.libsonnet index 8420fe54..da83e54b 100644 --- a/component/common.libsonnet +++ b/component/common.libsonnet @@ -9,14 +9,15 @@ local evaluate_log_format = function(component) local render_image(imagename, include_tag=false) = local imagespec = params.images[imagename]; + local img = '%(registry)s/%(repository)s' % imagespec; local image = if std.objectHas(imagespec, 'image') && imagespec.image != null then std.trace( - 'Field `image` for selecting the container image `%s` has been deprecated in favor of fields `registry` and `repository`, please update your config' % imagename, - imagespec.image + 'Field `image` for selecting the container image `%s` has been removed. Please use fields `registry` and `repository` instead' % imagename, + img ) else - '%(registry)s/%(repository)s' % imagespec; + img; if include_tag then '%(image)s:%(tag)s' % { image: image, tag: imagespec.tag } else diff --git a/docs/modules/ROOT/pages/references/parameters.adoc b/docs/modules/ROOT/pages/references/parameters.adoc index e833a97c..25b377b1 100644 --- a/docs/modules/ROOT/pages/references/parameters.adoc +++ b/docs/modules/ROOT/pages/references/parameters.adoc @@ -41,6 +41,7 @@ SSH known hosts for Git servers. type:: dictionary Dictionary containing the container images used by this component. +Each entry follows the https://syn.tools/syn/explanations/commodore-components/container-images.html[Commodore component best practices] for specifying container images. == `log_level` diff --git a/tests/golden/params/argocd/argocd/25_hooks/hooks.yaml b/tests/golden/params/argocd/argocd/25_hooks/hooks.yaml index 969aa626..141fc061 100644 --- a/tests/golden/params/argocd/argocd/25_hooks/hooks.yaml +++ b/tests/golden/params/argocd/argocd/25_hooks/hooks.yaml @@ -86,7 +86,7 @@ spec: env: - name: HOME value: /home - image: mymirror.io/kubectl:1.28.4@sha256:9aa77d80cf5d32e0345c8468a45d39134a8016e30eccddaf720bf197ad7dd9f0 + image: docker.io/bitnami/kubectl:1.28.4@sha256:9aa77d80cf5d32e0345c8468a45d39134a8016e30eccddaf720bf197ad7dd9f0 imagePullPolicy: IfNotPresent name: argocd-post-sync ports: []