Summary
The apps.cozystack.io aggregated apiserver does not honour --dry-run=server: a server-side dry-run write to an Application resource is persisted instead of being simulated and discarded. A dry-run request must run admission and return the would-be result without mutating storage.
Reproduce (verified live)
kubectl patch vmdisk <name> -n <tenant> --type=merge -p '{"spec":{"storageClass":"local"}}' --dry-run=server
- kubectl reports
vmdisk ... patched (no (dry run) marker).
kubectl get vmdisk <name> -n <tenant> -o jsonpath='{.spec.storageClass}' → returns local. The change was written to real storage despite --dry-run=server.
Impact
Any tooling or operator that relies on server-side dry-run against Application kinds — kubectl apply --dry-run=server, kubectl diff, admission previews — mutates the cluster instead of previewing. This is dangerous precisely for the read-only workflows dry-run exists to make safe.
Suggested direction
Thread the dryRun option through the Application registry's create/update paths so a server dry-run runs defaulting/validation and returns the result object without persisting, matching apiserver semantics.
Discovered while investigating #2985 (see also #3969).
Summary
The
apps.cozystack.ioaggregated apiserver does not honour--dry-run=server: a server-side dry-run write to an Application resource is persisted instead of being simulated and discarded. A dry-run request must run admission and return the would-be result without mutating storage.Reproduce (verified live)
kubectl patch vmdisk <name> -n <tenant> --type=merge -p '{"spec":{"storageClass":"local"}}' --dry-run=servervmdisk ... patched(no(dry run)marker).kubectl get vmdisk <name> -n <tenant> -o jsonpath='{.spec.storageClass}'→ returnslocal. The change was written to real storage despite--dry-run=server.Impact
Any tooling or operator that relies on server-side dry-run against Application kinds —
kubectl apply --dry-run=server,kubectl diff, admission previews — mutates the cluster instead of previewing. This is dangerous precisely for the read-only workflows dry-run exists to make safe.Suggested direction
Thread the
dryRunoption through the Application registry's create/update paths so a server dry-run runs defaulting/validation and returns the result object without persisting, matching apiserver semantics.Discovered while investigating #2985 (see also #3969).