Skip to content

Mirror Application.status.conditions verbatim on HelmRelease#25

Merged
tamalsaha merged 1 commit into
masterfrom
mirror-app-conditions
Jun 2, 2026
Merged

Mirror Application.status.conditions verbatim on HelmRelease#25
tamalsaha merged 1 commit into
masterfrom
mirror-app-conditions

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

Argo CD surfaces real failures (chart pulled but repo unknown, malformed Application spec, sync errors, shared/orphaned/excluded resource warnings, ...) as entries in `Application.status.conditions[]`. Until now fargocd only mirrored the sync code and the health code, so users had to fetch the Application themselves to see the actual cause.

This PR mirrors each Argo CD condition onto the HelmRelease verbatim, alongside the existing Ready/Reconciling pair.

Mapping

metav1.Condition field Source
`Type` `ApplicationCondition.Type` (e.g. `ComparisonError`, `InvalidSpecError`, `SyncError`, `SharedResourceWarning`)
`Status` `True` — presence in Argo's array means the condition is active
`Reason` `ApplicationCondition.Type` (verbatim, no rewriting)
`Message` `ApplicationCondition.Message`
`LastTransitionTime` Argo's `LastTransitionTime` if set, else `now`

Why

So `kubectl describe helmrelease foo` shows the underlying problem without a second hop into the Application. Closes the corresponding entry in Design.md "Future work".

What changed

  • `pkg/controller/helmrelease_controller.go` — `updateHelmReleaseStatus` now appends one `metav1.Condition` per `app.Status.Conditions` entry.
  • `pkg/controller/helmrelease_controller_test.go` — new `TestStatusMirrorsApplicationConditions` covering both a warning and an error condition.
  • `Design.md` — "Status mirror" step now lists the third group; the "Future work" bullet removed.

Test plan

  • `GOFLAGS=-mod=vendor go build ./...` clean.
  • `GOFLAGS=-mod=vendor go test ./... -short -race` — all packages pass; the new test asserts both the verbatim Type/Reason/Message mirroring and that the legacy Ready/Reconciling conditions still land.
  • `GOFLAGS=-mod=vendor golangci-lint run ./...` — 0 issues.

Argo CD surfaces real-world failures (chart pulled but repo unknown,
malformed Application spec, sync errors, shared/orphaned/excluded
resource warnings, ...) as entries in
`Application.status.conditions[]`. Until now fargocd only mirrored the
sync code and health code, so users had to fetch the Application
themselves to see the actual cause.

Mirror each Argo CD condition onto the HelmRelease verbatim, alongside
the existing Ready/Reconciling pair:

  - Type   = ApplicationCondition.Type    (e.g. ComparisonError)
  - Status = True                         (presence == active)
  - Reason = ApplicationCondition.Type    (verbatim, no rewriting)
  - Message = ApplicationCondition.Message
  - LastTransitionTime = Argo's LastTransitionTime, or now if unset

Now `kubectl describe helmrelease foo` shows the underlying problem
without a second hop. Add a fake-client test covering both an Argo CD
warning and an error condition.

Design.md updated to document the new behaviour and the corresponding
"Future work" bullet removed.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit 35944ca into master Jun 2, 2026
3 checks passed
@tamalsaha tamalsaha deleted the mirror-app-conditions branch June 2, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant