Merge pull request #74787 from jianglingxia/fixbugiscsi

fix bug iscsi volume attach failed of /sys/class/iscsi_host dir not e…
This commit is contained in:
Kubernetes Prow Robot 2019-03-06 09:50:51 -08:00 committed by GitHub
commit b82868bb7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ package util
import (
"errors"
"fmt"
"os"
"path"
"strconv"
"strings"
@ -99,6 +100,9 @@ func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (
sysPath := "/sys/class/iscsi_host"
hostDirs, err := io.ReadDir(sysPath)
if err != nil {
if os.IsNotExist(err) {
return portalHostMap, nil
}
return nil, err
}
for _, hostDir := range hostDirs {