Skip to content

Commit

Permalink
scanner: correct the autoProvision mechanism
Browse files Browse the repository at this point in the history
    - we should not set both `Spec.Filesystem.Provisioned` and
      `Spec.Provision` or the remove operation would be blocked if
      we only change one of these to false.

    This is a side-effect that comes from 1877a4e.
    For now, we will remove one of these two fields to ensure the delete operation
    work. We still need mutator to help convert these two fields.

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
  • Loading branch information
Vicente-Cheng committed Sep 27, 2024
1 parent 78e0d91 commit ff6b725
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/controller/blockdevice/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ func (s *Scanner) SaveBlockDevice(bd *diskv1.BlockDevice, autoProvisioned bool)
if autoProvisioned {
bd.Spec.FileSystem.ForceFormatted = true
bd.Spec.FileSystem.Provisioned = true
bd.Spec.Provision = true
}
logrus.Infof("Add new block device %s with device: %s", bd.Name, bd.Spec.DevPath)
return s.Blockdevices.Create(bd)
Expand Down

0 comments on commit ff6b725

Please sign in to comment.