Skip to content

Commit

Permalink
provisioner: ensure the device is ready before adding into volume group
Browse files Browse the repository at this point in the history
    - The filesystem metadata would break the pvcreate

Signed-off-by: Vicente Cheng <[email protected]>
  • Loading branch information
Vicente-Cheng committed Oct 23, 2024
1 parent b258580 commit 02c0fb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/provisioner/lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ func (l *LVMProvisioner) GetProvisionerName() string {
return l.name
}

func (l *LVMProvisioner) Format(string) (bool, bool, error) {
// LVM provisioner does not need format
// Format operation on the LVM use to ensure the device is clean and ready to be used by LVM.
func (l *LVMProvisioner) Format(devPath string) (isFormatComplete, isRequeueNeeded bool, err error) {
if _, err := utils.NewExecutor().Execute("wipefs", []string{"-a", devPath}); err != nil {
return false, false, err
}
return true, false, nil
}

Expand Down

0 comments on commit 02c0fb9

Please sign in to comment.