Skip to content

fix(configmap): expose gitops.applicationHealthCheckEnabled and other operator keys - #53

Open
butler54 wants to merge 2 commits into
validatedpatterns:mainfrom
butler54:fix/expose-operator-config-keys
Open

butler54 wants to merge 2 commits into
validatedpatterns:mainfrom
butler54:fix/expose-operator-config-keys

Conversation

@butler54

@butler54 butler54 commented Nov 3, 2026

Copy link
Copy Markdown

Summary

The patterns-operator supports several gitops.* keys on the patterns-operator-config ConfigMap, but this chart — the supported install path for every pattern — only rendered a subset of them. The missing keys could only be set by writing the ConfigMap out of band after install, which is not available on the connected make install path at all.

This PR renders each operator-consumed key when it is set, using the same idiom as the existing additionalArgoAdmins/argoRBAC/customArgoYaml blocks. Empty-string defaults preserve current behaviour exactly (default render is byte-identical; the snapshot test confirms).

Key Why it matters
gitops.applicationHealthCheckEnabled The headline fix — see below
gitops.customHealthChecks Operator appends these to the ArgoCD CR health checks; previously unreachable
gitops.sourceNamespace Listed as a comment in the template but never rendered
gitops.installApprovalPlan Same
gitops.csv Same

Why applicationHealthCheckEnabled matters

ArgoCD 1.8 dropped the built-in Application health check (argoproj/argo-cd#3781). The patterns-operator can restore it, but defaults it off. Without it, an app-of-apps root Application treats child Applications as immediately healthy and applies all sync waves at once, defeating wave ordering entirely.

Observed live on validatedpatterns/coco-pattern (15 child applications):

ConfigMap key Root app behaviour
absent (chart default, before this PR) all 15 child Applications created within ~4 s; wave-30 workloads raced a wave-20 KBS/trustee and wedged on stale initdata
"true" (written out of band) wave-ordered creation 0 → 10 → 15 → 20 → 30; workloads only created after trustee was Healthy+Synced

applicationHealthCheckEnabled is rendered quoted because the operator compares strings.EqualFold(v, "true") against ConfigMap string data.

Deliberate non-goals

  • No change to the operator's default (policy question, out of scope here).
  • Not steering users to gitops.customArgoYaml for this: the operator applies that key with mergo.Merge(..., mergo.WithOverride), which replaces spec.resourceHealthChecks wholesale and would silently drop the operator's built-in PVC and Subscription checks. Exposing the native key avoids that trap.

Consumer impact / release note

No config change is needed for consumers to pick this up: rhvp.cluster_utils.install renders the chart with helm template {{ pattern_install_chart }} and passes no --version, so an OCI reference resolves the highest semver tag. Patterns opt in by setting main.gitops.applicationHealthCheckEnabled: "true" in values-global.yaml.

Chart version bumped to 0.0.19; the v0.0.19 tag on merge triggers the usual publish workflow.

Test plan

  • helm lint — clean.
  • helm template A/B: default render unchanged (all five keys absent); each key renders with the expected form when set (block scalar for customHealthChecks, quoted string for applicationHealthCheckEnabled).
  • make helm-unittest (helm-unittest 3.14.4-0.5.0): 59/59 pass, including 10 new cases (absent-by-default + set-value for each key) and the unchanged snapshot.

Fixes #52
Refs validatedpatterns/coco-pattern#165

…mHealthChecks

The patterns-operator supports these keys on the patterns-operator-config
ConfigMap but the chart never rendered them, so app-of-apps sync-wave
gating was silently inert on every install through this chart (the
operator defaults the health check to off, and ArgoCD 1.8 dropped the
Application health check).

Render each key when it is set, using the same idiom as the existing
additionalArgoAdmins/argoRBAC/customArgoYaml blocks. Empty-string
defaults preserve current behaviour.

applicationHealthCheckEnabled is quoted because the operator compares
strings.EqualFold(v, "true") against ConfigMap string data.

Fixes validatedpatterns#52
…d csv

These operator-consumed keys were listed as comments in the template
but never rendered, so they could only be set by writing the ConfigMap
out of band. Render each when set, empty-string defaults preserving
current behaviour.
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.

patterns-operator-config ConfigMap omits gitops.applicationHealthCheckEnabled, so app-of-apps sync-wave gating is silently inert

1 participant