feat(host-deployer): try again if the partition cannot be found

This commit is contained in:
rainzm
2021-09-16 17:38:35 +08:00
parent ce3e4ac385
commit 95abcef299

View File

@@ -175,6 +175,15 @@ func (d *NBDDriver) setupLVMS() (bool, error) {
for i := 0; i < len(subparts); i++ {
lvmPartitions = append(lvmPartitions, subparts[i])
}
} else {
log.Infof("wait a second and try again")
time.Sleep(time.Second)
subparts := lvm.FindPartitions()
if len(subparts) > 0 {
for i := 0; i < len(subparts); i++ {
lvmPartitions = append(lvmPartitions, subparts[i])
}
}
}
}
}