Skip to content

Commit 0371fd2

Browse files
authored
Merge branch 'master' into docs/manifest-paths-clarification
2 parents 32f743d + 8fa3e47 commit 0371fd2

File tree

9 files changed

+65
-39
lines changed

9 files changed

+65
-39
lines changed

.github/workflows/bump-major-version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
working-directory: /home/runner/go/src/github.com/argoproj/argo-cd
3838

3939
- name: Setup Golang
40-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
40+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
4141
with:
4242
go-version: ${{ env.GOLANG_VERSION }}
4343
- name: Add ~/go/bin to PATH

.github/workflows/ci-build.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Checkout code
5858
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
5959
- name: Setup Golang
60-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
60+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
6161
with:
6262
go-version: ${{ env.GOLANG_VERSION }}
6363
- name: Download all Go modules
@@ -78,7 +78,7 @@ jobs:
7878
- name: Checkout code
7979
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
8080
- name: Setup Golang
81-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
81+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
8282
with:
8383
go-version: ${{ env.GOLANG_VERSION }}
8484
- name: Restore go build cache
@@ -105,7 +105,7 @@ jobs:
105105
- name: Checkout code
106106
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
107107
- name: Setup Golang
108-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
108+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
109109
with:
110110
go-version: ${{ env.GOLANG_VERSION }}
111111
- name: Run golangci-lint
@@ -133,7 +133,7 @@ jobs:
133133
- name: Create symlink in GOPATH
134134
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
135135
- name: Setup Golang
136-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
136+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
137137
with:
138138
go-version: ${{ env.GOLANG_VERSION }}
139139
- name: Install required packages
@@ -197,7 +197,7 @@ jobs:
197197
- name: Create symlink in GOPATH
198198
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
199199
- name: Setup Golang
200-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
200+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
201201
with:
202202
go-version: ${{ env.GOLANG_VERSION }}
203203
- name: Install required packages
@@ -253,7 +253,7 @@ jobs:
253253
- name: Checkout code
254254
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
255255
- name: Setup Golang
256-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
256+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
257257
with:
258258
go-version: ${{ env.GOLANG_VERSION }}
259259
- name: Create symlink in GOPATH
@@ -449,7 +449,7 @@ jobs:
449449
- name: Checkout code
450450
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
451451
- name: Setup Golang
452-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
452+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
453453
with:
454454
go-version: ${{ env.GOLANG_VERSION }}
455455
- name: GH actions workaround - Kill XSP4 process

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Use correct go version. https://github.com/github/codeql-action/issues/1842#issuecomment-1704398087
3535
- name: Setup Golang
36-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
36+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3737
with:
3838
go-version-file: go.mod
3939

.github/workflows/image-reuse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
if: ${{ github.ref_type != 'tag'}}
6868

6969
- name: Setup Golang
70-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
70+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
7171
with:
7272
go-version: ${{ inputs.go-version }}
7373
cache: false

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
run: git fetch --force --tags
7171

7272
- name: Setup Golang
73-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
73+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
7474
with:
7575
go-version: ${{ env.GOLANG_VERSION }}
7676
cache: false
@@ -153,7 +153,7 @@ jobs:
153153
token: ${{ secrets.GITHUB_TOKEN }}
154154

155155
- name: Setup Golang
156-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
156+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
157157
with:
158158
go-version: ${{ env.GOLANG_VERSION }}
159159
cache: false

CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
/.github/** @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
1313
/.goreleaser.yaml @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
1414
/sonar-project.properties @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
15+
16+
# CLI
17+
/cmd/argocd/** @argoproj/argocd-approvers @argoproj/argocd-approvers-cli
18+
/cmd/main.go @argoproj/argocd-approvers @argoproj/argocd-approvers-cli
19+
/docs/operator-manual/ @argoproj/argocd-approvers @argoproj/argocd-approvers-cli

docs/operator-manual/upgrading/3.1-3.2.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,25 @@ The `ManifestRequest` and `RepoServerAppDetailsQuery` messages are used by the f
4040

4141
## CronJob Health
4242

43-
This realease introduce the addition of CronJob's health, a longtime omitted heath status for a native Kubernetes resource.
44-
The health of a CronJob is based on whether or not Jobs are currently running, and if the last completed Job was successful.
43+
After the upgrade, Application's status may transition to `Degraded` depending on the CronJob health.
4544

46-
After the upgrade, Application's status may transition to `Degraded`, `Progressing` or `Suspended` depending on the CronJob health.
45+
!!! note "CronJob with running jobs"
4746

48-
If the CronJob is permanently `Suspended`, then the aggregated health of the Application will now be `Suspended` instead of `Healthy`.
49-
If the CronJob is permanently running jobs, then the aggregated health of the Application will now be `Progressing` instead of `Healthy`.
47+
If the CronJob is `Degraded` and a new job is scheduled, the health will change to `Healthy` until the active job completes.
48+
This may cause your application to go from `Degraded` to `Healthy` to `Degraded` again. The CronJob status does not contain enough
49+
information to infer the health of the last completed job if there are active jobs.
5050

51-
If you do not want your CronJob to affect the Application's aggregated Health, you can configure the annotation
52-
`argocd.argoproj.io/ignore-healthcheck: "true"` on the CronJob resource.
51+
If the CronJob constantly has active jobs, the health will be constantly `Healthy` even if the last job failed.
52+
53+
!!! note "CronJob with suspended state"
5354

54-
The health can also be configured globally using the `resource.customizations.health.batch_CronJob` configuration to change the default behaviour.
55+
If the CronJob is in a suspended state, the CronJob status will remain Healthy. You can override this behaviour by configuring the
56+
health check using the `resource.customizations.health.batch_CronJob` key in the argocd-cm ConfigMap.
5557

56-
## Breaking Changes
58+
If you decide to do so and the CronJob is `Suspended`, then the aggregated health of the Application will now be `Suspended` instead of `Healthy`.
59+
60+
If you do not want your CronJob to affect the Application's aggregated Health, you can configure the annotation
61+
`argocd.argoproj.io/ignore-healthcheck: "true"` on the CronJob resource.
5762
5863
## Sanitized project API response
5964

resource_customizations/batch/CronJob/health.lua

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,52 @@
11
hs = {}
22

33
if obj.spec.suspend == true then
4-
hs.status = "Suspended"
4+
-- Set to Healthy insted of Suspended until bug is resolved
5+
-- See https://github.com/argoproj/argo-cd/issues/24428
6+
hs.status = "Healthy"
57
hs.message = "CronJob is Suspended"
68
return hs
79
end
810

911
if obj.status ~= nil then
10-
if obj.status.active ~= nil and table.getn(obj.status.active) > 0 then
11-
-- We could be Progressing very often, depending on the Cron schedule, which would bubble up
12-
-- to the Application health. If this is undesired, the annotation `argocd.argoproj.io/ignore-healthcheck: "true"`
13-
-- can be added on the CronJob.
14-
hs.status = "Progressing"
15-
hs.message = string.format("Waiting for %d Jobs to complete", table.getn(obj.status.active))
16-
return hs
17-
end
12+
if obj.status.lastScheduleTime ~= nil then
13+
14+
-- Job is running its first execution and has not yet reported any success
15+
if obj.status.lastSuccessfulTime == nil then
16+
-- Set to healthy even if it may be degraded, because we dont know
17+
-- if it was not yet executed or if it never succeeded
18+
hs.status = "Healthy"
19+
hs.message = "The Cronjob never completed succesfully. It may not be healthy"
20+
return hs
21+
end
22+
23+
24+
-- Job is progressing, so lastScheduleTime will always be grater than lastSuccessfulTime
25+
-- Set to healthy since we do not know if it is Degraded
26+
-- See https://github.com/argoproj/argo-cd/issues/24429
27+
if obj.status.active ~= nil and table.getn(obj.status.active) > 0 then
28+
hs.status = "Healthy"
29+
hs.message = "The job is running. Its last execution may not have been successful"
30+
return hs
31+
end
1832

1933
-- If the CronJob has no active jobs and the lastSuccessfulTime < lastScheduleTime
2034
-- then we know it failed the last execution
21-
if obj.status.lastScheduleTime ~= nil then
22-
-- No issue comparing time as text
23-
if obj.status.lastSuccessfulTime == nil or obj.status.lastSuccessfulTime < obj.status.lastScheduleTime then
35+
if obj.status.lastSuccessfulTime ~= nil and obj.status.lastSuccessfulTime < obj.status.lastScheduleTime then
2436
hs.status = "Degraded"
2537
hs.message = "CronJob has not completed its last execution successfully"
2638
return hs
2739
end
40+
2841
hs.message = "CronJob has completed its last execution successfully"
42+
hs.status = "Healthy"
43+
return hs
2944
end
3045

3146
-- There is no way to know if as CronJob missed its execution based on status
3247
-- so we assume Healthy even if a cronJob is not getting scheduled.
3348
-- https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#job-creation
49+
hs.message = "CronJob has not been scheduled yet"
3450
hs.status = "Healthy"
3551
return hs
3652
end

resource_customizations/batch/CronJob/health_test.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ tests:
55
inputPath: testdata/healthy.yaml
66
- healthStatus:
77
status: Healthy
8-
message: ''
8+
message: CronJob has not been scheduled yet
99
inputPath: testdata/never-scheduled.yaml
1010
- healthStatus:
1111
status: Degraded
1212
message: CronJob has not completed its last execution successfully
1313
inputPath: testdata/degraded.yaml
1414
- healthStatus:
15-
status: Degraded
16-
message: CronJob has not completed its last execution successfully
15+
status: Healthy
16+
message: The Cronjob never completed succesfully. It may not be healthy
1717
inputPath: testdata/never-succeeded.yaml
1818
- healthStatus:
19-
status: Progressing
20-
message: Waiting for 1 Jobs to complete
19+
status: Healthy
20+
message: The job is running. Its last execution may not have been successful
2121
inputPath: testdata/active.yaml
2222
- healthStatus:
23-
status: Suspended
23+
status: Healthy
2424
message: CronJob is Suspended
2525
inputPath: testdata/suspended.yaml

0 commit comments

Comments
 (0)