Skip to content

Commit 7842460

Browse files
committed
chore: add script to update argocd dependencies and images
Signed-off-by: Jonathan West <[email protected]>
1 parent 75d8bc3 commit 7842460

File tree

16 files changed

+773
-10
lines changed

16 files changed

+773
-10
lines changed

.github/workflows/lint.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code scans
1+
name: "Validation, verifications, and lints"
22
on:
33
pull_request:
44
paths-ignore:
@@ -24,3 +24,16 @@ jobs:
2424
- name: Ensure there is no diff in code
2525
run: |
2626
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
27+
28+
verify_argo_cd_has_updated_dependencies:
29+
name: Verify Argo CD has updated dependencies, for the given target version
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v5
34+
- name: "Call update dependencies Makefile target"
35+
run: |
36+
make update-dependencies
37+
- name: Ensure there is no unexpected diff in repository artifacts
38+
run: |
39+
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
66
VERSION ?= 0.17.0
77

8+
# ARGO_CD_TARGET_VERSION is the target version that argocd-operator will install.
9+
# Update this when you upgrade the Argo CD dependencies of the project.
10+
# After updating, call 'make update-dependencies'.
11+
# Notes:
12+
# - String should NOT begin with 'v' prefix, e.g. 'v3.1.1'
13+
ARGO_CD_TARGET_VERSION ?= 3.1.8
14+
815
# Try to detect Docker or Podman
916
CONTAINER_RUNTIME := $(shell command -v docker 2> /dev/null || command -v podman 2> /dev/null)
1017

@@ -361,3 +368,8 @@ if [ $$(printf '%s\n' $$requiredver $$currentver | sort -V | head -n1) = $$requi
361368
rm -rf $$TMP_DIR ;\
362369
}
363370
endef
371+
372+
# Updates upstream dependencies throughout the repository
373+
.PHONY: update-dependencies
374+
update-dependencies:
375+
"hack/update-dependencies-script/run.sh"

build/util/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Argo CD v3.1.1
2-
FROM quay.io/argoproj/argocd@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040 AS argocd
1+
# Argo CD v3.1.8
2+
FROM quay.io/argoproj/argocd@sha256:19ba7f44cba487c4a0c98ac336327c4df04383dff84f87ea1a578972eb62dd17 as argocd
33

44
# Final Image
55
FROM docker.io/library/ubuntu:24.04

common/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const (
7070
ArgoCDDefaultArgoImage = "quay.io/argoproj/argocd"
7171

7272
// ArgoCDDefaultArgoVersion is the Argo CD container image digest to use when version not specified.
73-
ArgoCDDefaultArgoVersion = "sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040" // v3.1.1
73+
ArgoCDDefaultArgoVersion = "sha256:19ba7f44cba487c4a0c98ac336327c4df04383dff84f87ea1a578972eb62dd17" // v3.1.8
7474

7575
// ArgoCDDefaultBackupKeyLength is the length of the generated default backup key.
7676
ArgoCDDefaultBackupKeyLength = 32

config/crd/bases/argoproj.io_applications.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5887,4 +5887,4 @@ spec:
58875887
type: object
58885888
served: true
58895889
storage: true
5890-
subresources: {}
5890+
subresources: {}

config/crd/bases/argoproj.io_applicationsets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17721,4 +17721,4 @@ spec:
1772117721
served: true
1772217722
storage: true
1772317723
subresources:
17724-
status: {}
17724+
status: {}

config/crd/bases/argoproj.io_appprojects.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,4 @@ spec:
363363
- spec
364364
type: object
365365
served: true
366-
storage: true
366+
storage: true

controllers/argocd/applicationset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ func TestGetApplicationSetContainerImage(t *testing.T) {
14811481
cr.Spec.Image = ""
14821482
cr.Spec.Version = ""
14831483
out = getApplicationSetContainerImage(&cr)
1484-
assert.Equal(t, "quay.io/argoproj/argocd@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040", out)
1484+
assert.Equal(t, "quay.io/argoproj/argocd@"+common.ArgoCDDefaultArgoVersion, out)
14851485

14861486
// when env var is not set and spec image and version fields are set, spec fields should be returned
14871487
cr.Spec.Image = "customimage"
@@ -1502,5 +1502,5 @@ func TestGetApplicationSetContainerImage(t *testing.T) {
15021502
cr.Spec.Version = ""
15031503
os.Setenv(common.ArgoCDImageEnvName, "")
15041504
out = getApplicationSetContainerImage(&cr)
1505-
assert.Equal(t, "customimage@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040", out)
1505+
assert.Equal(t, "customimage@"+common.ArgoCDDefaultArgoVersion, out)
15061506
}

controllers/argocd/dex_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ func TestReconcileArgoCD_reconcileDexDeployment_withUpdate(t *testing.T) {
581581
Containers: []corev1.Container{
582582
{
583583
Name: "dex",
584-
Image: "ghcr.io/dexidp/dex@sha256:b08a58c9731c693b8db02154d7afda798e1888dc76db30d34c4a0d0b8a26d913",
584+
Image: "ghcr.io/dexidp/dex@sha256:b08a58c9731c693b8db02154d7afda798e1888dc76db30d34c4a0d0b8a26d913", // (v2.43.0) NOTE: this value is modified by dependency update script
585585
Command: []string{
586586
"/shared/argocd-dex",
587587
"rundex",

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ require (
175175
)
176176

177177
replace (
178+
// This replace block is from Argo CD v3.1.8 go.mod
178179
github.com/golang/protobuf => github.com/golang/protobuf v1.5.4
179180
github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.16.0
180181

0 commit comments

Comments
 (0)