mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-06 23:23:23 +09:00
A BucketAccess's keys are bound to its UID, so letting Helm delete the BucketAccess the converted chart no longer renders would revoke every existing user's keys. Migration 71 runs before any chart changes version and marks each tenant BucketAccess the bucket chart rendered with helm.sh/resource-policy=keep, which Helm reads off the live object, and with the adoption label cozystack-controller looks for, so clients keep working until the first mint. It also marks the backup bucket's system user platform, so that bucket keeps its readable Secret whichever chart is upgraded first. The old chart wrote a tenant user's accessKey and secretKey through stringData, so the manifest Helm diffs against never named them in data and the upgrade to the converted bucket-system chart would keep them: tenants could read working keys until the first mint. The migration removes the two keys from each tenant user's Secret before the chart switch, checking for them without reading the values, and leaves a platform user's Secret alone. It applies the baked CredentialTemplate CRD first, as migration 64 does. A cluster that ran 64 in an earlier release keeps the CRD without spec.bucketAccess until cozystack-controller upgrades, which can be after the bucket releases switch; the API server would prune the field and the controller would skip the template for good. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>