Skip to content

Commit

Permalink
Merge pull request #10878 from daehyeok/rootless_docker
Browse files Browse the repository at this point in the history
Add solution message if Docker is rootless
  • Loading branch information
medyagh authored Mar 23, 2021
2 parents ebb13e5 + 9b23841 commit 18c1cc2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
10 changes: 9 additions & 1 deletion pkg/drivers/kic/oci/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/minikube/registry/drvs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 18c1cc2

Please sign in to comment.