Repository navigation
fix(configmap): expose gitops.applicationHealthCheckEnabled and other operator keys - #53
Conversation
…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
left a comment
There was a problem hiding this comment.
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)
customHealthChecksas a native YAML list breakshelm template. Handle lists withtoYaml.sourceNamespace,installApprovalPlanandcsvare unquoted, so numeric, boolean or null-looking values break the ConfigMap or get changed (e.g.1.10becomes1.1).
P2: strongly recommended (the operator silently ignores bad values)
applicationHealthCheckEnabled: anything other than"true"counts as false, which brings back the sync-wave race.installApprovalPlan: case-sensitiveManual, otherwise silently Automatic.customHealthChecks: invalid YAML is dropped by the operator with only a log line. Validate at render time.
P3: cleanup / nice to have
- Regenerate README with
make helm-docs(version badge is stale). - Strengthen the
customHealthCheckstest to assertequal. - Remove the stale
gitops.ManualSync/gitops.namecomments. - 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 |
There was a problem hiding this comment.
[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.
|
/lgtm |
Summary
The patterns-operator supports several
gitops.*keys on thepatterns-operator-configConfigMap, 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 connectedmake installpath at all.This PR renders each operator-consumed key when it is set, using the same idiom as the existing
additionalArgoAdmins/argoRBAC/customArgoYamlblocks. Empty-string defaults preserve current behaviour exactly (default render is byte-identical; the snapshot test confirms).gitops.applicationHealthCheckEnabledgitops.customHealthChecksgitops.sourceNamespacegitops.installApprovalPlangitops.csvWhy
applicationHealthCheckEnabledmattersArgoCD 1.8 dropped the built-in
Applicationhealth 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):
"true"(written out of band)applicationHealthCheckEnabledis rendered quoted because the operator comparesstrings.EqualFold(v, "true")against ConfigMap string data.Deliberate non-goals
gitops.customArgoYamlfor this: the operator applies that key withmergo.Merge(..., mergo.WithOverride), which replacesspec.resourceHealthCheckswholesale 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.installrenders the chart withhelm template {{ pattern_install_chart }}and passes no--version, so an OCI reference resolves the highest semver tag. Patterns opt in by settingmain.gitops.applicationHealthCheckEnabled: "true"invalues-global.yaml.Chart version bumped to 0.0.19; the
v0.0.19tag on merge triggers the usual publish workflow.Test plan
helm lint— clean.helm templateA/B: default render unchanged (all five keys absent); each key renders with the expected form when set (block scalar forcustomHealthChecks, quoted string forapplicationHealthCheckEnabled).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