Skip to content

Commit 878da9f

Browse files
authored
Argo CD : checksum support for the install url (#12266)
Fixes #12223
1 parent ede92b0 commit 878da9f

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

roles/kubernetes-apps/argocd/defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ argocd_enabled: false
33
argocd_version: 2.14.5
44
argocd_namespace: argocd
55
# argocd_admin_password:
6-
argocd_install_url: "https://raw.githubusercontent.com/argoproj/argo-cd/v{{ argocd_version }}/manifests/install.yaml"

roles/kubernetes-apps/argocd/tasks/main.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,17 @@
2020
- name: namespace
2121
file: argocd-namespace.yml
2222
- name: install
23-
file: argocd-install.yml
23+
file: "{{ downloads.argocd_install.dest | basename }}"
2424
namespace: "{{ argocd_namespace }}"
25-
url: "{{ argocd_install_url }}"
25+
download: "{{ downloads.argocd_install }}"
2626
when:
2727
- "inventory_hostname == groups['kube_control_plane'][0]"
2828

2929
- name: Kubernetes Apps | Download ArgoCD remote manifests
3030
include_tasks: "../../../download/tasks/download_file.yml"
3131
vars:
32-
download_argocd:
33-
enabled: "{{ argocd_enabled }}"
34-
file: true
35-
dest: "{{ local_release_dir }}/{{ item.file }}"
36-
url: "{{ item.url }}"
37-
unarchive: false
38-
owner: "root"
39-
mode: "0644"
40-
sha256: ""
41-
download: "{{ download_defaults | combine(download_argocd) }}"
42-
with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}"
32+
download: "{{ download_defaults | combine(item.download) }}"
33+
with_items: "{{ argocd_templates | selectattr('download', 'defined') | list }}"
4334
loop_control:
4435
label: "{{ item.file }}"
4536
when:
@@ -54,15 +45,15 @@
5445
owner: false
5546
group: false
5647
delegate_to: "{{ inventory_hostname }}"
57-
with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}"
48+
with_items: "{{ argocd_templates | selectattr('download', 'defined') | list }}"
5849
when:
5950
- "inventory_hostname == groups['kube_control_plane'][0]"
6051

6152
- name: Kubernetes Apps | Set ArgoCD namespace for remote manifests
6253
become: true
6354
command: |
6455
{{ bin_dir }}/yq eval-all -i '.metadata.namespace="{{ argocd_namespace }}"' {{ kube_config_dir }}/{{ item.file }}
65-
with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}"
56+
with_items: "{{ argocd_templates | selectattr('download', 'defined') | list }}"
6657
loop_control:
6758
label: "{{ item.file }}"
6859
when:
@@ -74,7 +65,7 @@
7465
src: "{{ item.file }}.j2"
7566
dest: "{{ kube_config_dir }}/{{ item.file }}"
7667
mode: "0644"
77-
with_items: "{{ argocd_templates | selectattr('url', 'undefined') | list }}"
68+
with_items: "{{ argocd_templates | selectattr('download', 'undefined') | list }}"
7869
loop_control:
7970
label: "{{ item.file }}"
8071
when:

roles/kubespray_defaults/defaults/main/download.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ youki_version: "{{ (youki_checksums['amd64'] | dict2items)[0].key }}"
8080
gvisor_version: "{{ (gvisor_runsc_binary_checksums['amd64'] | dict2items)[0].key }}"
8181
containerd_version: "{{ (containerd_archive_checksums['amd64'] | dict2items)[0].key }}"
8282
cri_dockerd_version: "{{ (cri_dockerd_archive_checksums['amd64'] | dict2items)[0].key }}"
83+
argocd_version: "{{ (argocd_install_checksums.no_arch | dict2items)[0].key }}"
8384

8485
# this is relevant when container_manager == 'docker'
8586
docker_containerd_version: 1.6.32
@@ -170,6 +171,7 @@ containerd_download_url: "{{ github_url }}/containerd/containerd/releases/downlo
170171
cri_dockerd_download_url: "{{ github_url }}/Mirantis/cri-dockerd/releases/download/v{{ cri_dockerd_version }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tgz"
171172
skopeo_download_url: "{{ github_url }}/lework/skopeo-binary/releases/download/v{{ skopeo_version }}/skopeo-linux-{{ image_arch }}"
172173
yq_download_url: "{{ github_url }}/mikefarah/yq/releases/download/v{{ yq_version }}/yq_linux_{{ image_arch }}"
174+
argocd_install_url: "https://raw.githubusercontent.com/argoproj/argo-cd/v{{ argocd_version }}/manifests/install.yaml"
173175
gateway_api_crds_download_url: "{{ github_url }}/kubernetes-sigs/gateway-api/releases/download/v{{ gateway_api_version }}/{{ gateway_api_channel }}-install.yaml"
174176

175177
etcd_binary_checksum: "{{ etcd_binary_checksums[image_arch][etcd_version] }}"
@@ -178,6 +180,7 @@ kubelet_binary_checksum: "{{ kubelet_checksums[image_arch][kube_version] }}"
178180
kubectl_binary_checksum: "{{ kubectl_checksums[image_arch][kube_version] }}"
179181
kubeadm_binary_checksum: "{{ kubeadm_checksums[image_arch][kube_version] }}"
180182
yq_binary_checksum: "{{ yq_checksums[image_arch][yq_version] }}"
183+
argocd_install_checksum: "{{ argocd_install_checksums.no_arch[argocd_version] }}"
181184
calicoctl_binary_checksum: "{{ calicoctl_binary_checksums[image_arch][calico_ctl_version] }}"
182185
ciliumcli_binary_checksum: "{{ ciliumcli_binary_checksums[image_arch][cilium_cli_version] }}"
183186
crictl_binary_checksum: "{{ crictl_checksums[image_arch][crictl_version] }}"
@@ -1090,6 +1093,19 @@ downloads:
10901093
groups:
10911094
- kube_control_plane
10921095

1096+
argocd_install:
1097+
enabled: "{{ argocd_enabled }}"
1098+
file: true
1099+
version: "{{ argocd_version }}"
1100+
dest: "{{ local_release_dir }}/argocd-install.yml"
1101+
checksum: "{{ argocd_install_checksum }}"
1102+
url: "{{ argocd_install_url }}"
1103+
unarchive: false
1104+
owner: "root"
1105+
mode: "0644"
1106+
groups:
1107+
- kube_control_plane
1108+
10931109
download_defaults:
10941110
container: false
10951111
file: false

roles/kubespray_defaults/vars/main/checksums.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,3 +1253,6 @@ gateway_api_experimental_crds_checksums:
12531253
1.2.0: sha256:4369188e63b9ab5a35b5a83032c94d871159dece086b908b6ea18ea321ca06a9
12541254
1.1.0: sha256:10f322744a005d4e73e2b067e95fecd4cfec619dc7564930b488c296bfa3bec1
12551255
1.0.0: sha256:6c601dced7872a940d76fa667ae126ba718cb4c6db970d0bab49128ecc1192a3
1256+
argocd_install_checksums:
1257+
no_arch:
1258+
2.14.5: sha256:247ccda29c9faac4e0c8598680f5ebefff9911e957e3aeaf838eb4bbf455f2f4

0 commit comments

Comments
 (0)