Skip to content

Commit

Permalink
Merge pull request #1189 from torredil/fix-windows-volume-id-empty
Browse files Browse the repository at this point in the history
Fix windows mounting bug-1090
  • Loading branch information
k8s-ci-robot authored Mar 23, 2022
2 parents 4301947 + c6b269f commit c95a14a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/mounter/safe_mounter_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ func (mounter *CSIProxyMounter) FormatAndMount(source string, target string, fst
return err
}

// Ensure the disk is online before mounting.
setDiskStateRequest := &disk.SetDiskStateRequest{
DiskNumber: uint32(diskNumber),
IsOnline: true,
}
_, err = mounter.DiskClient.SetDiskState(context.Background(), setDiskStateRequest)
if err != nil {
return err
}

// List the volumes on the given disk.
volumeIDsRequest := &volume.ListVolumesOnDiskRequest{
DiskNumber: uint32(diskNumber),
Expand Down

0 comments on commit c95a14a

Please sign in to comment.