Skip to content

Commit

Permalink
Remove support for legacy image field for image specifications
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
simu committed Nov 20, 2023
1 parent 5390502 commit 50a6c89
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions component/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion tests/golden/params/argocd/argocd/25_hooks/hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ spec:
env:
- name: HOME
value: /home
image: mymirror.io/kubectl:1.28.4@sha256:9aa77d80cf5d32e0345c8468a45d39134a8016e30eccddaf720bf197ad7dd9f0
image: mymirror.io/bitnami/kubectl:1.28.4@sha256:9aa77d80cf5d32e0345c8468a45d39134a8016e30eccddaf720bf197ad7dd9f0
imagePullPolicy: IfNotPresent
name: argocd-post-sync
ports: []
Expand Down
2 changes: 1 addition & 1 deletion tests/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
registry: mymirror.io
repository: vault
kubectl:
image: mymirror.io/kubectl
registry: mymirror.io
kube_rbac_proxy:
registry: mymirror.io
tag: v1.1.1
Expand Down

0 comments on commit 50a6c89

Please sign in to comment.