Skip to content

fix(storage/minio): empty share.policies/users render as [], not null (v0.1.2) - #577

Merged
patrick-hermann-sva merged 1 commit into
mainfrom
fix/minio-empty-users
Nov 25, 2026
Merged

patrick-hermann-sva merged 1 commit into
mainfrom
fix/minio-empty-users

Conversation

@patrick-hermann-sva

Copy link
Copy Markdown
Contributor

Bug

A MinioBucket without access entries, or with only user: false ones, rendered status.share.users (and without access also .policies) as a bare key → null. The XR's status update is then rejected:

cannot apply composite resource status: MinioBucket.storage.stuttgart-things.com "tofu-state" is invalid:
[status.share.users: Invalid value: "null": share.users in body must be of type array: "null", ...]

and the XR sits at Ready=False (Unready resources: bucket, policy-writer) forever, although bucket and policy are Available. Found with tofu-state on machinery-labul (#482, stuttgart-things#4951) — the first policy-only bucket in the fleet; every LabDA bucket has a user, which is why nothing showed it. Functionally harmless (bucket and policy exist), but the XR never goes green.

Fix

Both lists are built first and emitted with toJson, so empty is [].

Tests

The status.share branch only renders once the bucket is observed Ready, and no golden covered it (CLAUDE.md gotcha 6). New observed fixtures:

  • xr-min--applied: policies: [], users: [] — reproduced null before the fix
  • xr-max--applied: 3 policies, 2 users, the user: false entry correctly left out

crossplane resource validate against the XRD: both rendered XRs pass; the old shape (users: null) fails with exactly the cluster's message. Existing goldens unchanged. Lint 0 errors.

Rollout

v0.1.2. The machinery clusters run v0.1.0 from the catalog — needs a catalog pin bump to reach them.

🤖 Generated with Claude Code

… (v0.1.2)

A MinioBucket without access entries, or with only 'user: false' ones,
rendered status.share.users (and, without access, .policies) as a bare key,
i.e. null. The API server rejected the XR's status update
('share.users ... must be of type array: "null"'), so the XR stayed at
Ready=False forever although bucket and policy were Available. Found with
tofu-state on machinery-labul (crossplane-configurations#482), the first
policy-only bucket in the fleet; every LabDA bucket has a user, which is why
nothing showed it.

Both lists are now built first and emitted with toJson. New observed
fixtures xr-min--applied (empty lists) and xr-max--applied (3 policies,
2 users, the user: false entry left out) cover status.share, which no golden
rendered before (CLAUDE.md gotcha 6). crossplane resource validate: the
rendered XRs pass; the old null shape fails with the cluster's message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrick-hermann-sva
patrick-hermann-sva merged commit 2d56241 into main Nov 25, 2026
4 of 5 checks passed
@patrick-hermann-sva
patrick-hermann-sva deleted the fix/minio-empty-users branch November 25, 2026 15:00
@github-actions

Copy link
Copy Markdown
Contributor

📦 ttl.sh preview packages

Preview OCI packages for the Configurations changed in this PR, pushed to the public, ephemeral ttl.sh registry. No auth required — install on any Crossplane v2 cluster:

📦 storage/minio → ttl.sh/stuttgart-things/crossplane-configurations-pr577-3fdb86a/minio:24h
apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
  name: minio-preview
spec:
  package: ttl.sh/stuttgart-things/crossplane-configurations-pr577-3fdb86a/minio:24h

Note

Images expire 24h after the last push (ttl.sh's maximum TTL); push a new commit to refresh them. The Configuration name is suffixed -preview so it won't clash with a canonical install.

This branch had an error being deployed

1 failed and 1 active deployments
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.

1 participant