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>
(cherry picked from commit d5b7347)
  • Loading branch information
Vicente-Cheng committed Sep 27, 2024
1 parent f59434b commit 57ce9db
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/controller/blockdevice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ func (c *Controller) updateDeviceStatus(device *diskv1.BlockDevice, devPath stri
logrus.Infof("Auto provisioning block device %s", device.Name)
device.Spec.FileSystem.ForceFormatted = true
device.Spec.FileSystem.Provisioned = true
device.Spec.Provision = true
}
return nil
}
Expand Down
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 57ce9db

Please sign in to comment.