Repository navigation
fix(webhook): reject edits to spec.volumeClaimTemplates - #127
Merged
Merged
Conversation
A StatefulSet's volumeClaimTemplates are immutable. An edit on a live VinylCache passed admission, and every later reconcile then failed on the StatefulSet update, leaving the cache in a permanent error loop until the edit was reverted (#46). ValidateUpdate now passes the old object to ValidateVinylCacheUpdate, which runs the common checks and rejects any change to the templates. It compares with semantic equality, so 1Gi against 1024Mi, or nil against an empty list, is not a change. The error and the SSD how-to explain the way out. The PVCs outlive the VinylCache and are bound again by a recreated one, so recreating alone does not resize them: resize the PVCs, or delete them too. Closes #46 Assisted-by: Claude Opus 5.5
jensens
force-pushed
the
fix/immutable-volumeclaimtemplates
branch
from
October 27, 2026 14:32
eb18aa0 to
9f1fd07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46. Part of the 1.0 API hardening (#106 (comment)).
Problem
A StatefulSet's
volumeClaimTemplatesare immutable. An edit on a live VinylCache passed admission. Every following reconcile then failed on the StatefulSet update, and the cache stayed in an error loop until the edit was reverted.Change
ValidateUpdatepasses the old object to the newValidateVinylCacheUpdate. That function runs the existing common checks and rejects any change tospec.volumeClaimTemplates.equality.Semantic.DeepEqual, so1Giagainst1024Mi, ornilagainst[], is not a change.The error message differs from the one proposed in the issue. The issue suggested "delete and recreate the VinylCache (PVCs are preserved)". But the operator sets no
persistentVolumeClaimRetentionPolicy, so the defaultRetainapplies, and a recreated cache binds the old PVCs again at their old size. The message and the SSD how-to therefore say what actually works:Verification
ValidateVinylCache(newObj)) this spec fails, which shows it really exercises the old object.make lint,make test,make test-intare green.Assisted-by: Claude Opus 5.5