Skip to content

fix(platform): stop handing tenants a root S3 the root tenant does not run - #5097

Open
europrinter (yankawai) wants to merge 1 commit into
cozystack:mainfrom
yankawai:fix/platform-root-s3-flag
Open

europrinter (yankawai) wants to merge 1 commit into
cozystack:mainfrom
yankawai:fix/platform-root-s3-flag

Conversation

@yankawai

@yankawai europrinter (yankawai) commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

cozystack-basics writes seaweedfs: tenant-root into the cozystack-values Secret of the root tenant unconditionally, so every tenant without its own SeaweedFS inherits tenant-root as its S3, even when Tenant/root has spec.seaweedfs: false. On a v1.6.5 cluster whose root tenant runs no SeaweedFS, a tenant created a Bucket, its BucketClaim asked for bucket class tenant-root, and the objectstorage controller logged bucketclasses.objectstorage.k8s.io "tenant-root" not found 8796 times over three days while the app stayed Ready. #5096 makes that state visible in WorkloadsReady, this PR removes its cause.

The new platform value seaweedfs.rootEnabled reaches cozystack-basics as _cluster.seaweedfs-enabled, the same way monitoring.rootEnabled reaches it as _cluster.monitoring-enabled for #3181, and _namespace.seaweedfs: tenant-root is written only when it is true. The default true keeps today's behaviour. The slim variants, which do not install SeaweedFS for the root tenant, set it to false next to monitoring.rootEnabled. Without S3 up the tenant chain the bucket and harbor charts now fail to render with a message that names the problem, instead of creating a claim for a class that never appears. A lookup of the live Tenant is not used, for the reason monitoring-external-services.yaml gives for the monitoring gate.

An existing Bucket or Harbor in a tenant without S3 up its chain fails its next upgrade with that message once the flag is false. Its BucketClaim was never provisioned, so nothing that worked stops working.

A new apps_seaweedfs_enabled_wiring_test.yaml in the platform chart pins the flag in _cluster for the default, false and null cases. cozystack-values-secret_test.yaml keeps etcd, ingress and monitoring unconditional and checks seaweedfs for an absent, "true" and "false" flag. New s3_backend_test.yaml suites in bucket and harbor check the class and the refusal. With helm-unittest 1.1.2 the platform passes 288 of 288, cozystack-basics 69 of 69, bucket 13 of 13 and harbor 49 of 49. Against the templates on main the new cases fail, 3 in the platform, 1 in cozystack-basics and 1 each in bucket and harbor, and the rest pass. The harbor suites that render every template already set _namespace.seaweedfs, and the full e2e sets spec.seaweedfs: true on the root Tenant and keeps the default. I have not run the change on a live cluster.

Screenshots

Not a UI change.

Downstream repositories

packages/core/platform/values.yaml gains seaweedfs.rootEnabled, which the trigger map routes to platform-package.md on the website. The variants page lists what the slim variants need for SeaweedFS, so it gets the same note as monitoring. No app schema, values default or other contract changes.

Release note

fix(platform): new platform value seaweedfs.rootEnabled. Set it to false when the root tenant runs no SeaweedFS, so tenants stop inheriting tenant-root as their S3 and a Bucket or Harbor without S3 up its tenant chain fails to render with a clear message instead of waiting on a bucket class that does not exist.

Summary by CodeRabbit

  • New Features
    • Added a setting to control whether the root tenant provides SeaweedFS for S3. It is enabled by default and disabled in slim ISP configurations.
    • Tenant configuration now includes SeaweedFS only when root provision is enabled.
  • Bug Fixes
    • Bucket and Harbor deployments now report a clear error when neither the tenant nor an ancestor provides SeaweedFS, rather than rendering an unusable S3 bucket claim.

…t run

cozystack-basics wrote seaweedfs: tenant-root into the root values
unconditionally, so every tenant without its own SeaweedFS inherited
tenant-root as its S3 even when Tenant/root runs none. A Bucket there got
a BucketClaim for a bucket class that never appears, and Harbor got its
registry bucket the same way.

seaweedfs.rootEnabled records that choice the way monitoring.rootEnabled
does for monitoring, and the bucket and harbor charts refuse to render
without S3 up the tenant chain rather than wait on a class that does not
exist.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <[email protected]>
@github-actions github-actions Bot added area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files labels Oct 25, 2026
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 55aad6f and 5a6460d.

Files selected for processing: 12
  • packages/apps/bucket/templates/bucketclaim.yaml
  • packages/apps/bucket/tests/s3_backend_test.yaml
  • packages/apps/harbor/templates/bucket.yaml
  • packages/apps/harbor/tests/s3_backend_test.yaml
  • packages/core/platform/templates/apps.yaml
  • packages/core/platform/tests/apps_seaweedfs_enabled_wiring_test.yaml
  • packages/core/platform/values-isp-hosted-slim.yaml
  • packages/core/platform/values-isp-slim-generic.yaml
  • packages/core/platform/values-isp-slim.yaml
  • packages/core/platform/values.yaml
  • packages/system/cozystack-basics/templates/cozystack-values-secret.yaml
  • packages/system/cozystack-basics/tests/cozystack-values-secret_test.yaml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Walkthrough

The platform now configures root SeaweedFS availability and passes that setting through shared values. The shared tenant values Secret conditionally includes SeaweedFS. Bucket and Harbor templates now stop rendering when the tenant has no SeaweedFS S3 backend.

Changes: SeaweedFS S3 availability

Layer / File(s) Summary
Configure and propagate root availability
packages/core/platform/values.yaml, packages/core/platform/values-isp-*.yaml, packages/core/platform/templates/apps.yaml, packages/core/platform/tests/apps_seaweedfs_enabled_wiring_test.yaml
Adds seaweedfs.rootEnabled, defaulting to true, and sets it to false in ISP slim configurations. The platform template writes seaweedfs-enabled using this setting. Tests cover the default, disabled, and null configuration cases.
Conditionally expose SeaweedFS to tenants
packages/system/cozystack-basics/templates/cozystack-values-secret.yaml, packages/system/cozystack-basics/tests/cozystack-values-secret_test.yaml
The shared values Secret includes _namespace.seaweedfs when _cluster.seaweedfs-enabled is missing or true, and omits it when false. Tests cover these cases and check that monitoring remains present when SeaweedFS is omitted.
Require an available bucket backend
packages/apps/bucket/templates/bucketclaim.yaml, packages/apps/bucket/tests/s3_backend_test.yaml, packages/apps/harbor/templates/bucket.yaml, packages/apps/harbor/tests/s3_backend_test.yaml
Bucket and Harbor templates fail rendering when the tenant’s SeaweedFS value is empty or unset. Tests check rendering with a configured bucket class and the error for a missing backend.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PlatformValues
  participant AppsTemplate
  participant BasicsSecret
  participant BucketTemplates
  PlatformValues->>AppsTemplate: Set seaweedfs.rootEnabled
  AppsTemplate->>BasicsSecret: Provide seaweedfs-enabled
  BasicsSecret->>BucketTemplates: Include _namespace.seaweedfs when enabled
  BucketTemplates->>BucketTemplates: Fail rendering if the value is absent
Loading

Possibly related issues

  • Issue 5092: The platform setting is added to shared values and copied into a Secret, which is related to the issue’s reported upgrade behavior.

Possibly related PRs

  • cozystack/cozystack#5096: This PR addresses the bucket-claim provisioning path, while #5096 changes workload readiness when a bucket claim is not provisioned.

Suggested labels: kind/bug, size/L, area/storage

Suggested reviewers: lexfrei, kvaps

Merge Risk: Minimal · up to 5a646

The configuration now rejects Bucket and Harbor deployments without an available SeaweedFS backend. No actionable merge-blocking risk was established.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main behavior change: the platform stops giving tenants a root S3 endpoint that the root tenant does not run. The changeset adds seaweedfs.rootEnabled, gates cozystack-basics' seaw…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main behavior change: the platform stops giving tenants a root S3 endpoint that the root tenant does not run. The changeset adds seaweedfs.rootEnabled, gates cozystack-basics' seaweedfs: tenant-root output on it, and makes the Bucket and Harbor charts fail when no S3 is configured up the tenant chain. The title is specific, follows the conventional commit style, and fits within a reasonable length. It is a bit long at 74 characters and omits the new failing-render behavior for Bucket and Harbor, but it captures the primary intent.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (12 skipped: 12 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

europrinter (@yankawai) The gate is right; two things before it can merge.

  1. Conflict with main in platform/templates/apps.yaml, platform/values.yaml, cozystack-basics/templates/cozystack-values-secret.yaml and its test: main now gates _namespace.ingress on _cluster.ingress-enabled the same way. Keep both gates, and update the comment and the test names that say etcd, ingress and monitoring are unconditional: after the merge only etcd and monitoring are. I didn't merge it myself because those sentences need your wording.

  2. Release note: slim variants now set seaweedfs.rootEnabled: false, but values-isp-slim.yaml allows opting SeaweedFS in on Tenant/root. Such a cluster loses _namespace.seaweedfs on upgrade and its Buckets and Harbors fail the next render. Add that slim clusters running root SeaweedFS must set seaweedfs.rootEnabled: true.

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

Labels

area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants