mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
probeAttachedVolume improvement in Cinder
This commit is contained in:
parent
7b9affae66
commit
4aac6a80a3
@ -44,7 +44,7 @@ var _ volume.Attacher = &cinderDiskAttacher{}
|
|||||||
var _ volume.AttachableVolumePlugin = &cinderPlugin{}
|
var _ volume.AttachableVolumePlugin = &cinderPlugin{}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
checkSleepDuration = 1 * time.Second
|
checkSleepDuration = 5 * time.Second
|
||||||
operationFinishInitDealy = 1 * time.Second
|
operationFinishInitDealy = 1 * time.Second
|
||||||
operationFinishFactor = 1.1
|
operationFinishFactor = 1.1
|
||||||
operationFinishSteps = 10
|
operationFinishSteps = 10
|
||||||
|
@ -224,6 +224,18 @@ func probeAttachedVolume() error {
|
|||||||
scsiHostRescan()
|
scsiHostRescan()
|
||||||
|
|
||||||
executor := exec.New()
|
executor := exec.New()
|
||||||
|
|
||||||
|
// udevadm settle waits for udevd to process the device creation
|
||||||
|
// events for all hardware devices, thus ensuring that any device
|
||||||
|
// nodes have been created successfully before proceeding.
|
||||||
|
argsSettle := []string{"settle", "--timeout=1"}
|
||||||
|
cmdSettle := executor.Command("udevadm", argsSettle...)
|
||||||
|
_, errSettle := cmdSettle.CombinedOutput()
|
||||||
|
if errSettle != nil {
|
||||||
|
glog.Errorf("error running udevadm settle %v\n", errSettle)
|
||||||
|
return errSettle
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{"trigger"}
|
args := []string{"trigger"}
|
||||||
cmd := executor.Command("udevadm", args...)
|
cmd := executor.Command("udevadm", args...)
|
||||||
_, err := cmd.CombinedOutput()
|
_, err := cmd.CombinedOutput()
|
||||||
|
Loading…
Reference in New Issue
Block a user