Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code scans
name: "Validation, verifications, and lints"
on:
pull_request:
paths-ignore:
Expand All @@ -24,3 +24,16 @@ jobs:
- name: Ensure there is no diff in code
run: |
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .

verify_argo_cd_has_updated_dependencies:
name: Verify Argo CD has updated dependencies, for the given target version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: "Call update dependencies Makefile target"
run: |
make update-dependencies
- name: Ensure there is no unexpected diff in repository artifacts
run: |
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.17.0

# ARGO_CD_TARGET_VERSION is the target version that argocd-operator will install.
# Update this when you upgrade the Argo CD dependencies of the project.
# After updating, call 'make update-dependencies'.
# Notes:
# - String should NOT begin with 'v' prefix, e.g. 'v3.1.1'
ARGO_CD_TARGET_VERSION ?= 3.1.8

# Try to detect Docker or Podman
CONTAINER_RUNTIME := $(shell command -v docker 2> /dev/null || command -v podman 2> /dev/null)

Expand Down Expand Up @@ -361,3 +368,8 @@ if [ $$(printf '%s\n' $$requiredver $$currentver | sort -V | head -n1) = $$requi
rm -rf $$TMP_DIR ;\
}
endef

# Updates upstream dependencies throughout the repository
.PHONY: update-dependencies
update-dependencies:
"hack/update-dependencies-script/run.sh"
4 changes: 2 additions & 2 deletions build/util/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Argo CD v3.1.1
FROM quay.io/argoproj/argocd@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040 AS argocd
# Argo CD v3.1.8
FROM quay.io/argoproj/argocd@sha256:19ba7f44cba487c4a0c98ac336327c4df04383dff84f87ea1a578972eb62dd17 as argocd

# Final Image
FROM docker.io/library/ubuntu:24.04
Expand Down
2 changes: 1 addition & 1 deletion common/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const (
ArgoCDDefaultArgoImage = "quay.io/argoproj/argocd"

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

// ArgoCDDefaultBackupKeyLength is the length of the generated default backup key.
ArgoCDDefaultBackupKeyLength = 32
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/argoproj.io_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5887,4 +5887,4 @@ spec:
type: object
served: true
storage: true
subresources: {}
subresources: {}
2 changes: 1 addition & 1 deletion config/crd/bases/argoproj.io_applicationsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17721,4 +17721,4 @@ spec:
served: true
storage: true
subresources:
status: {}
status: {}
2 changes: 1 addition & 1 deletion config/crd/bases/argoproj.io_appprojects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,4 @@ spec:
- spec
type: object
served: true
storage: true
storage: true
4 changes: 2 additions & 2 deletions controllers/argocd/applicationset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ func TestGetApplicationSetContainerImage(t *testing.T) {
cr.Spec.Image = ""
cr.Spec.Version = ""
out = getApplicationSetContainerImage(&cr)
assert.Equal(t, "quay.io/argoproj/argocd@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040", out)
assert.Equal(t, "quay.io/argoproj/argocd@"+common.ArgoCDDefaultArgoVersion, out)

// when env var is not set and spec image and version fields are set, spec fields should be returned
cr.Spec.Image = "customimage"
Expand All @@ -1502,5 +1502,5 @@ func TestGetApplicationSetContainerImage(t *testing.T) {
cr.Spec.Version = ""
os.Setenv(common.ArgoCDImageEnvName, "")
out = getApplicationSetContainerImage(&cr)
assert.Equal(t, "customimage@sha256:a36ab0c0860c77159c16e04c7e786e7a282f04889ba9318052f0b8897d6d2040", out)
assert.Equal(t, "customimage@"+common.ArgoCDDefaultArgoVersion, out)
}
2 changes: 1 addition & 1 deletion controllers/argocd/dex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func TestReconcileArgoCD_reconcileDexDeployment_withUpdate(t *testing.T) {
Containers: []corev1.Container{
{
Name: "dex",
Image: "ghcr.io/dexidp/dex@sha256:b08a58c9731c693b8db02154d7afda798e1888dc76db30d34c4a0d0b8a26d913",
Image: "ghcr.io/dexidp/dex@sha256:b08a58c9731c693b8db02154d7afda798e1888dc76db30d34c4a0d0b8a26d913", // (v2.43.0) NOTE: this value is modified by dependency update script
Command: []string{
"/shared/argocd-dex",
"rundex",
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ require (
)

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

Expand Down
19 changes: 19 additions & 0 deletions hack/update-dependencies-script/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# update-dependencies-script

This is a simple go-based script that will upgrade the upstream dependencies in argocd-operator.

## To run this script:

In `(root)/Makefile`, modify `ARGO_CD_TARGET_VERSION` to target Argo CD version.

Example:
```
ARGO_CD_TARGET_VERSION ?= 3.1.8
```

Then run the script:
```
make update-dependencies
```

See `hack/update-dependencies-script/main.go` for list dependencies that are updated.
9 changes: 9 additions & 0 deletions hack/update-dependencies-script/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/argoproj-labs/argocd-operator/dependency-upgrade

go 1.20

require (
github.com/google/go-github/v58 v58.0.0
github.com/google/go-querystring v1.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0
)
10 changes: 10 additions & 0 deletions hack/update-dependencies-script/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw=
github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Loading