fix(platform): forward backupStorage overrides to the backupstrategy-controller Package#3333
fix(platform): forward backupStorage overrides to the backupstrategy-controller Package#3333Andrey Kolkov (androndo) wants to merge 7 commits into
Conversation
…controller Package (#3245) The documented admin override for the cozy-default backup S3 coordinates (spec.components.backupstrategy-controller.values on the cozystack.cozystack-platform Package) had no effect: that PackageSource exposes only the platform component, so the operator silently ignored the block, and nothing in the platform chart forwarded backupStorage to the child Package. Wire it the same way bundles/iaas.yaml forwards kubevirt / gpu-operator values: a new top-level backupStorage value on the platform chart is rendered into the emitted cozystack.backupstrategy-controller Package CR as components.backupstrategy-controller.values.backupStorage, from where the cozystack operator merges it into the backupstrategy-controller HelmRelease over the chart defaults. When backupStorage is unset the emitted Package is unchanged. Update docs/operations/backup-classes.md to the working override path (spec.components.platform.values.backupStorage) and call out the two plausible-looking paths that do not work. Add a helm-unittest suite covering the no-op default and the forwarding on isp-full and isp-full-generic. Fixes #3245 Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe platform chart adds a top-level ChangesBackup storage forwarding
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PlatformPackage
participant PlatformChart
participant BackupStrategyPackage
PlatformPackage->>PlatformChart: provide platform backupStorage values
PlatformChart->>BackupStrategyPackage: render forwarded component values
BackupStrategyPackage->>BackupStrategyPackage: apply backupStorage values
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where administrative overrides for Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements forwarding of backupStorage overrides from the cozystack-platform Package CR down to the backupstrategy-controller Package CR. It updates the platform chart templates to dynamically inject these values when configured, adds a comprehensive suite of Helm unit tests to verify the wiring behavior, and updates the documentation and default values.yaml to reflect the new configuration path. Since there are no review comments, no additional feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
IvanHunters
left a comment
There was a problem hiding this comment.
Verdict
LGTM
Every claim in the PR body was independently verified against the operator source, the chart helpers, and an offline byte-level render comparison; no blocking issues found on either the upgrade or the fresh-install scenario.
Caveats
- Existing-customer upgrade (Phase 5b-A), verified no breakage. With
backupStorageunset (the shipped default{}), the emittedPackage cozystack.backupstrategy-controlleris byte-identical to the historical render. Verified two ways: (1) the new unittest assertsnotExists: spec.components(packages/core/platform/tests/bundles_backupstorage_wiring_test.yaml:94-95), and (2) an isolatedhelm templateharness rendering the oldcozystack.platform.package.defaultcall vs the new 4-argcozystack.platform.packagecall with empty dict produced a zero-byte diff (empty dict is falsy attemplates/_helpers.tpl:20, so thecomponents:block is skipped). No migration script is needed andmigrations.targetVersionis correctly untouched: no cluster-side state changes, no renames, no adoption. Customers who previously worked around #3245 by patching the child Package directly see the same revert-on-reconcile behaviour as before when the new value is unset. Rollback is clean and two-way: downgrading drops the components block and the child HR reverts to chart defaults. - Fresh install (Phase 5b-B), verified no breakage. No new PackageSource, bundle entry,
dependsOn,_cluster/_namespacekey, image, or CRD.helm.sh/resource-policy: keepis preserved because the direct helper call goes through the samecozystack.platform.packagedefine that stamps it (templates/_helpers.tpl:17, confirmed in the set-case render). The forwarding block sits in the variant-agnostic tail oftemplates/bundles/system.yaml:219-233(after allbundles.system.variantconditionals), so it applies uniformly toisp-full,isp-full-generic, andisp-hosted. - Full value-flow chain verified end-to-end: the operator-generated
cozystack-platformPackageSource exposes exactly one component namedplatformfor every variant (cmd/cozystack-operator/main.go:692-702), which confirms both the bug diagnosis (the old documentedspec.components.backupstrategy-controllerpath matched no component and was silently dropped by the reconciler loop atinternal/operator/package_reconciler.go:197-204) and the fix path (spec.components.platform.values.backupStoragelands on the platform HR viapackage_reconciler.go:292-293, the chart forwards it into the child Package, and the child PackageSource'sbackupstrategy-controllercomponent does carry aninstall:block atpackages/core/platform/sources/backupstrategy-controller.yaml, so the reconciler consumes the forwarded values rather than dropping them). - Every knob named in the
values.yamlcomment (provisionBucket,bucketName,endpoint,region,forcePathStyle,systemSecretName,systemNamespaces) exists inpackages/system/backupstrategy-controller/values.yaml. - Reproduced the test claim:
helm unittest .inpackages/core/platformpasses 22 suites / 91 tests, matching the PR body exactly. - The bootstrap chart-lint render error (
repository.yamlOCIRepository lookup requires a live cluster) and the.Values.registries.*missing-refs are pre-existing chart-wide conditions (registries: {}atvalues.yaml:483), not introduced by this PR. - The new tests cover
isp-fullandisp-full-genericbut notisp-hosted. Not blocking: the forwarding code is outside the variant conditionals, so the code path is identical; noted only for completeness.
…review findings (next + v1.5) The admin-override example documented a path the cozystack operator silently ignores (cozystack/cozystack#3245): that PackageSource exposes only the platform component. cozystack/cozystack#3333 wires the working path — spec.components.platform.values.backupStorage — which the platform chart forwards into the backupstrategy-controller component. Update the example in both next/ and v1.5/, explain the forwarding, call out the two plausible-looking paths that do not work, use the same platform Package path in the external-S3 section, and add the new backupStorage key to the platform-package values reference tables. Review fixes from PR #622 (IvanHunters, gemini, coderabbit): - add aliases frontmatter on backup-classes.md for the two deleted pages, so published permalinks (release announcements link them as absolute URLs) keep resolving - replace the malformed BSL readiness check (jsonpath '=' 'Available' passed as extra kubectl args) with kubectl wait --for=jsonpath='{.status.phase}'=Available, and rephrase the tenant-facing variant to 'returns Available' - namespace the flux reconcile example (-n cozy-backup-controller, the namespace the backupstrategy-controller HelmRelease actually lives in per packages/core/platform/sources/backupstrategy-controller.yaml) - link the FoundationDB caveat section instead of quoting its title - 'After v1.4' -> 'Starting with v1.4' in the upgrade note - mention Etcd in the tenant guide intro/description and add etcd.aenix.io/EtcdBackup to the escalation diagnostics list - merge the duplicated Backup Classes bullet in See also Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
Same note as the website copy (cozystack/website#622 review round 2): name the explicit version boundary instead of 'pre-PR / After this PR', so the two documents cannot diverge — the empty-string defaults and useSystemBucket shipped in release-1.5. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
The backupstrategy-controller HelmRelease lives in cozy-backup-controller (packages/core/platform/sources/ backupstrategy-controller.yaml), so the un-namespaced command fails out of the box. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
… namespace knob and bslEnabled gap Keep the monorepo doc aligned with the website copy (cozystack/website#622 branch-review round 3): full cozystack_backup_credentials_projection_* metric names with range vectors in the alerting examples, the intro no longer conflates the Bucket CR name with the COSI-assigned S3 bucket name, the knob table gains the backupStorage.namespace row, and the external-S3 section states that the Velero BSL derives from the same backupStorage block while velero.bslEnabled is not carried by the override path. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/operations/backup-classes.md`:
- Line 107: Update the backup credential alert recommendation to detect stale
successes using counter activity rather than absent_over_time. Scope an
increase() check to each expected namespace, or use an exposed last-success
gauge/heartbeat, while retaining the existing failure-rate alert.
- Line 164: Update the external S3 instructions to use the supported platform
Package configuration path, `spec.components.platform.values.backupStorage` on
`cozystack.cozystack-platform`, instead of direct `backupstrategy-controller`
values. Preserve the existing guidance for `provisionBucket`, source
credentials, `endpoint`, and `region`, and clarify that only the `backupStorage`
block is forwarded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d8140cf1-5d6b-4dbc-b8bd-feae2ae5bee9
📒 Files selected for processing (1)
docs/operations/backup-classes.md
| - `cozystack_backup_credentials_projection_failures_total` | ||
|
|
||
| Alert on `rate(failures_total) > 0` or `absent_over_time(successes_total[10m])` to catch a stale BSL credential or a malformed source Secret without log scraping. | ||
| Alert on `rate(cozystack_backup_credentials_projection_failures_total[5m]) > 0` or `absent_over_time(cozystack_backup_credentials_projection_successes_total[10m])` to catch a stale BSL credential or a malformed source Secret without log scraping. |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Use counter activity, not absent_over_time, for stale-success detection.
absent_over_time() only fires when Prometheus has no samples for the metric; an unchanged success counter remains present and will not trigger it. It also does not detect a stale individual namespace when another namespace continues succeeding. Use increase() scoped to the expected namespace(s), or expose a last-success gauge/heartbeat instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/operations/backup-classes.md` at line 107, Update the backup credential
alert recommendation to detect stale successes using counter activity rather
than absent_over_time. Scope an increase() check to each expected namespace, or
use an exposed last-success gauge/heartbeat, while retaining the existing
failure-rate alert.
…ax, leader-election phrasing Same corrections as the website copy (cozystack/website#622 round 4): the re-render interval is 5m via the operator's helmrelease-interval flag (not a 10-minute Flux default), the FoundationDB backup CR group is apps.foundationdb.org, the BSL readiness check uses valid kubectl wait --for=jsonpath syntax, and the projector's first synchronous round is gated on leader election rather than pod readiness. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
… pin the override to the #3333 backport Branch-review round 5: release-1.5's strategy-foundationdb-default.yaml derives secure_connection from the endpoint scheme exactly like the MariaDB strategy does, so the endpoint knob row must name both (the page's own driver table already says 'derived secure flag' for FDB). And the v1.5 page documented the platform-Package override without saying that no shipped v1.5 patch carries the forwarding yet — state that it requires the cozystack/cozystack#3333 backport, so a v1.5.0-v1.5.2 admin is not handed the same silently-ignored block that #3245 was filed about. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
…the #3333 backport, mention RestoreJob projection Branch-review round 6: the v1.5 platform-package.md reference row documented backupStorage with no version caveat — a reader landing on the standalone table on v1.5.0-v1.5.2 would set a silently-ignored key, the exact trap #3245 describes; the row now points at the required cozystack/cozystack#3333 backport. Also credentials are projected for RestoreJob reconciles too (restorejob_controller.go), not only BackupJob — say so everywhere the projection timing is described. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
The projector runs from both the BackupJob and RestoreJob controllers (restorejob_controller.go), not only before BackupJobs — keep the monorepo doc aligned with the website copy (cozystack/website#622). Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
…he wiring test Branch-review on this PR: for provisionBucket: false the backupstrategy-controller.bucketName helper returns .Values.backupStorage.bucketName verbatim as the real S3 bucket name and every strategy CR plus the Velero BSL bakes it in, so the external-S3 section must require updating bucketName (the Secret's bucketName key alone is not read by the strategies), and the knob table must state the two-mode semantics instead of the COSI-only one. Also route the external-S3 instruction through the platform component override instead of naming raw chart values, and add the isp-hosted variant case to the forwarding test (92 tests green). Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
Mirrors the monorepo fix from the cozystack/cozystack#3333 review: with provisionBucket: false the bucketName value is taken verbatim as the real S3 bucket name by every strategy CR and the Velero BSL (no COSI lookup, the Secret's bucketName key alone is not read by the strategies), so the external-S3 section now requires updating it and the knob table states the two-mode semantics. Same helper behavior verified on release-1.5 for the v1.5 copy. Assisted-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com>
What this PR does
Fixes #3245.
The documented admin override for the
cozy-defaultbackup S3 coordinates —spec.components.backupstrategy-controller.valueson thePackage cozystack.cozystack-platform(docs/operations/backup-classes.md, "Admin overrides forcozy-default") — had no effect: thecozystack-platformPackageSource exposes exactly one component (platform), so the operator silently ignored the block, and the platform chart rendered the childPackage cozystack.backupstrategy-controllervia the.defaulthelper with no components argument, so nothing forwardedbackupStorageeither. Admins running against an external or TLS S3 had no working supported path to setbackupStorage.endpoint/region/systemSecretName.This PR wires the override through the platform chart, the same way
bundles/iaas.yamlforwards kubevirt and gpu-operator values:packages/core/platform/values.yamlgains a top-levelbackupStorage: {}value.templates/bundles/system.yamlrenders it into the emittedPackage cozystack.backupstrategy-controllerascomponents.backupstrategy-controller.values.backupStorage, from where the cozystack operator merges it into thebackupstrategy-controllerHelmRelease over the chart defaults. WhenbackupStorageis unset the components block is omitted and the emitted Package is byte-identical to the historical render.docs/operations/backup-classes.mdnow documents the working path (spec.components.platform.values.backupStorage) and explicitly calls out the two plausible-looking paths that do not work (the old documented one, and patching the child Package directly, which the platform helm-reconcile reverts).packages/core/platform/tests/bundles_backupstorage_wiring_test.yaml) is the behavioural regression test: it proves the unset case emits no components block and the set case lands the values on the child Package, on bothisp-fullandisp-full-generic.Verified with
make testinpackages/core/platform(22 suites, 91 tests, all green).make showrequires a live cluster (cozyhr+lookupintemplates/repository.yaml), so the unittest render oftemplates/bundles/system.yamlis the offline verification path.Screenshots
Not a UI change.
Downstream repositories
Walking the trigger map against the diff: the change to
packages/core/platform/values.yamlreaches cozystack/website twice —content/en/docs/next/operations/configuration/platform-package.md(hand-written table ofspec.components.platform.values.*keys gainsbackupStorage) andcontent/en/docs/next/operations/services/backup-classes.md(mirrors the broken override example this PR corrects). The follow-up is cozystack/website#622, which also carries the superseded website#547 content and covers the next/ and v1.5/ docs (release-1.4 does not ship the cozy-default feature, so v1.4 docs stay on the manual flow), marked not to merge before this PR lands; its v1.5 half assumes this fix is backported to release-1.5, hence the backport label. No other downstream repository restates the touched files: the templates change is chart-internal, no appvalues.schema.json, CRD, variant list,hack/file, or namespace changed.Release note
Summary by CodeRabbit
New Features
backupStorageconfiguration block that is conditionally forwarded to the backup controller.spec.componentsis only set whenbackupStorageis provided; defaults remain unchanged when unset.Documentation
Tests
backupStoragewiring for both the standard andisp-full-genericvariants.