Skip to content

Commit

Permalink
webhook: should also consider the old Spec.Filesystem.Provisioned
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Cheng <[email protected]>
  • Loading branch information
Vicente-Cheng committed Oct 16, 2024
1 parent b41057d commit 331ac23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/webhook/blockdevice/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (m *Mutator) Update(req *admission.Request, oldObj, newObj runtime.Object)
return patchOps, nil
}
// means we need to disable, align the .spec.filesystem.provisioned with .spec.provision -> false
if prevProvision && !newBd.Spec.FileSystem.Provisioned {
if prevProvision && !newBd.Spec.FileSystem.Provisioned && oldBd.Spec.FileSystem.Provisioned {
if newBd.Spec.Provision {
patchProvision := admission.PatchOp{
Op: admission.PatchOpReplace,
Expand Down

0 comments on commit 331ac23

Please sign in to comment.