Skip to content

Default storage version migrator to enabled in operator chart#5603

Open
ChrisJBurns wants to merge 2 commits into
mainfrom
chris/default-storage-version-migrator
Open

Default storage version migrator to enabled in operator chart#5603
ChrisJBurns wants to merge 2 commits into
mainfrom
chris/default-storage-version-migrator

Conversation

@ChrisJBurns

Copy link
Copy Markdown
Collaborator

Summary

The StorageVersionMigrator controller shipped opt-in (chart default false) so it could land without functional impact. Now that it has soaked through a release, this flips the operator Helm chart to enable it by default. Clusters then keep each CRD's status.storedVersions trimmed automatically — the precondition for a future release to drop deprecated API versions (e.g. v1alpha1) without orphaning etcd objects.

The operator binary still defaults the feature off when TOOLHIVE_ENABLE_STORAGE_VERSION_MIGRATOR is unset; only the chart default changes. Operators can still opt out with --set operator.features.storageVersionMigrator=false.

Medium level
  • values.yaml: operator.features.storageVersionMigrator flipped falsetrue, with the comment updated to describe the new default and how to opt out.
  • Tests: default_install_test.yaml now asserts the rendered env var is "true"; feature_flags_test.yaml gains an explicit opt-out case so the disabled path stays pinned (it was previously covered by the baseline suite).
  • Docs: chart README.md (regenerated via helm-docs), docs/operator/storage-version-migration.md, and the docs/operator/upgrade-guide/README.md walkthrough note updated to say enabled-by-default.
  • Source comments: the now-stale "opt-in / follow-up release will flip the default" comments on the operator's env-var gate (cmd/thv-operator/app/app.go) updated to reflect the binary-vs-chart distinction. No behavior change.
Low level
File Change
deploy/charts/operator/values.yaml Default storageVersionMigrator to true; reword comment
deploy/charts/operator/README.md Regenerated by helm-docs
deploy/charts/operator/tests/default_install_test.yaml Assert default env var renders "true"
deploy/charts/operator/tests/feature_flags_test.yaml Add opt-out (false) coverage; scope set per-test
docs/operator/storage-version-migration.md Describe controller as enabled-by-default
docs/operator/upgrade-guide/README.md Fix walkthrough note about the chart default
cmd/thv-operator/app/app.go Sync stale opt-in comments (comment-only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation
  • Other (chart default change)

Test plan

  • helm unittest deploy/charts/operator passes (59/59)
  • helm lint deploy/charts/operator passes
  • helm template renders TOOLHIVE_ENABLE_STORAGE_VERSION_MIGRATOR: "true" by default and "false" with --set ...=false
  • task build passes (covers the app.go comment change)

Does this introduce a user-facing change?

Yes. New chart installs/upgrades run the StorageVersionMigrator controller by default. The controller is dormant on CRDs whose storedVersions is already clean, so there is no functional impact in the common case. Operators who want the prior behavior can set operator.features.storageVersionMigrator=false.

Special notes for reviewers

The operator binary's default is intentionally unchanged (off when the env var is unset) — only the chart supplies the true value. The app.go change is comment-only to keep the source consistent with the new chart default per the repo's comment-sync convention.

Generated with Claude Code

The StorageVersionMigrator controller shipped opt-in (chart default
false) so it could land without functional impact. It has soaked through
a release, so make the operator helm chart enable it by default: clusters
get their CRD status.storedVersions kept clean automatically, which is the
precondition for a future release to drop deprecated API versions without
orphaning etcd objects.

- Flip operator.features.storageVersionMigrator to true in values.yaml
- Update the default-install test to assert the env var renders "true"
- Add explicit opt-out (false) coverage to the feature-flags suite
- Refresh the chart README, reference docs, and upgrade-guide notes
- Sync the now-stale opt-in comments in the operator's env-var gate
  (the binary still defaults off when the var is unset; the chart sets it)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Jun 23, 2026
reyortiz3
reyortiz3 previously approved these changes Jun 23, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.92%. Comparing base (9dca9dd) to head (01bffcf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5603      +/-   ##
==========================================
- Coverage   69.93%   69.92%   -0.02%     
==========================================
  Files         651      651              
  Lines       66405    66405              
==========================================
- Hits        46438    46431       -7     
- Misses      16616    16624       +8     
+ Partials     3351     3350       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJBurns

Copy link
Copy Markdown
Collaborator Author

/retest

2 similar comments
@ChrisJBurns

Copy link
Copy Markdown
Collaborator Author

/retest

@ChrisJBurns

Copy link
Copy Markdown
Collaborator Author

/retest

The StorageVersionMigrator watches cluster-scoped CustomResourceDefinitions
and re-stores custom resources across all namespaces, so it requires
cluster-scoped RBAC and a cluster-scoped manager cache. A namespace-scoped
operator gets only per-namespace RoleBindings and a namespace-restricted
cache, so the controller cannot sync its CRD informer and wedges the
manager — which is what broke the multi-tenancy chainsaw E2E once the
feature was defaulted on.

Add a Helm validation that fails the render when storageVersionMigrator is
true under operator.rbac.scope=namespace, with an actionable message. Fail
loudly rather than silently dropping the feature: a silent drop would let a
namespace-scoped admin believe storedVersions are being kept clean when they
are not, leading to the skip-a-version upgrade trap later.

- Add validateStorageVersionMigrator helper; invoke it from deployment.yaml
- Opt the namespace-scoped multi-tenancy chainsaw setup out of the migrator
- Pin the rejection and the supported namespace opt-out in helm unittests;
  disable the migrator in the namespace-scope suite's shared values
- Document the cluster-scope requirement and the standalone-migrator
  alternative for namespace-scoped clusters

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jhrozek

jhrozek commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

lgtm by visual inspection but conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants