Skip to content

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

Merged
mbaldessari merged 6 commits into
validatedpatterns:mainfrom
butler54:fix/expose-operator-config-keys
Nov 10, 2026
Merged

mbaldessari merged 6 commits into
validatedpatterns:mainfrom
butler54:fix/expose-operator-config-keys

Conversation

@butler54

@butler54 butler54 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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.

@yuvalk yuvalk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

I checked the five new keys against the patterns-operator source (internal/controller/patterns_operator_config.go). The names match, applicationHealthCheckEnabled is quoted correctly, and the default (all-unset) path renders fine. The problems show up when users set values in forms the template doesn't expect. Details are in the inline comments.

Suggested order to address

P1: must fix before merge (rendering or apply fails)

  1. customHealthChecks as a native YAML list breaks helm template. Handle lists with toYaml.
  2. sourceNamespace, installApprovalPlan and csv are unquoted, so numeric, boolean or null-looking values break the ConfigMap or get changed (e.g. 1.10 becomes 1.1).

P2: strongly recommended (the operator silently ignores bad values)

  1. applicationHealthCheckEnabled: anything other than "true" counts as false, which brings back the sync-wave race.
  2. installApprovalPlan: case-sensitive Manual, otherwise silently Automatic.
  3. customHealthChecks: invalid YAML is dropped by the operator with only a log line. Validate at render time.

P3: cleanup / nice to have

  1. Regenerate README with make helm-docs (version badge is stale).
  2. Strengthen the customHealthChecks test to assert equal.
  3. Remove the stale gitops.ManualSync / gitops.name comments.
  4. Consider exposing catalog.image, which the operator also reads from this ConfigMap.

🤖 Generated with Claude Code


# gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace
# gitops.installApprovalPlan: GitOpsDefaultApprovalPlan
# gitops.ManualSync: GitOpsDefaultManualSync

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Stale placeholder comments. gitops.ManualSync and gitops.name aren't keys the operator reads from this ConfigMap: ManualSync is a Pattern CR spec field, and the package name is hardcoded. Since the sourceNamespace and installApprovalPlan placeholders were removed, these two should probably go as well so nobody thinks they can be set here.

Comment thread README.md Resolved
@darkdoc

darkdoc commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@mbaldessari
mbaldessari merged commit 6f10bea into validatedpatterns:main Nov 10, 2026
3 checks passed
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

4 participants