Add solution message if Docker is rootless

pull/10878/head
Daehyeok Mun 2021-03-19 09:39:25 -07:00
parent 63a8f285bf
commit 9b23841ee3
3 changed files with 19 additions and 2 deletions

View File

@ -747,7 +747,7 @@ func validateDriver(ds registry.DriverState, existing *config.ClusterConfig) {
}
r := reason.MatchKnownIssue(reason.Kind{}, st.Error, runtime.GOOS)
if r.ID != "" {
if r != nil && r.ID != "" {
exitIfNotForced(*r, st.Error.Error())
}

View File

@ -32,6 +32,7 @@ type SysInfo struct {
TotalMemory int64 // TotalMemory Total available ram
OSType string // container's OsType (windows or linux)
Swarm bool // Weather or not the docker swarm is active
Rootless bool // Weather or not the docker is running on rootless mode
StorageDriver string // the storage driver for the daemon (for example overlay2)
Errors []string // any server issues
}
@ -62,7 +63,14 @@ func DaemonInfo(ociBin string) (SysInfo, error) {
return *cachedSysInfo, err
}
d, err := dockerSystemInfo()
cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType, Swarm: d.Swarm.LocalNodeState == "active", StorageDriver: d.Driver, Errors: d.ServerErrors}
rootless := false
for _, se := range d.SecurityOptions {
if strings.HasPrefix(se, "name=rootless") {
rootless = true
break
}
}
cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType, Swarm: d.Swarm.LocalNodeState == "active", Rootless: rootless, StorageDriver: d.Driver, Errors: d.ServerErrors}
return *cachedSysInfo, err
}

View File

@ -131,6 +131,15 @@ func status() registry.State {
return suggestFix("info", -1, serr, fmt.Errorf("docker info error: %s", serr))
}
if si.Rootless {
return registry.State{
Reason: "PROVIDER_DOCKER_ROOTLESS",
Error: errors.New("rootless Docker not supported yet"),
Installed: true,
Healthy: false,
Doc: "https://github.com/kubernetes/minikube/issues/10836"}
}
return checkNeedsImprovement()
}