nodes: improve handling of erroneous host names

This commit is contained in:
Di Xu
2018-06-06 14:36:15 +08:00
parent 8e2d37ee63
commit b3dfe0c652
13 changed files with 99 additions and 21 deletions

View File

@@ -318,7 +318,11 @@ func (util *RBDUtil) rbdUnlock(b rbdMounter) error {
}
// Construct lock id using host name and a magic prefix.
lock_id := kubeLockMagic + node.GetHostname("")
hostName, err := node.GetHostname("")
if err != nil {
return err
}
lock_id := kubeLockMagic + hostName
mon := util.kernelRBDMonitorsOpt(b.Mon)