Skip to content

Commit

Permalink
detect remote podman
Browse files Browse the repository at this point in the history
Co-authored-by: Andrea Frittoli <[email protected]>
  • Loading branch information
aojea and afrittoli committed May 18, 2021
1 parent a89d447 commit c3b3e10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/cluster/internal/providers/podman/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ func info(logger log.Logger) *providers.ProviderInfo {
info := &providers.ProviderInfo{
Rootless: euid != 0,
}

// check if is a local or remote podman
// xref: https://github.com/containers/podman/issues/10289
err := exec.Command("podman", "--remote", "info").Run()
if err == nil {
// podman is remote we can't check cgroups information so we exit now
return info
}
if _, err := os.Stat("/sys/fs/cgroup/cgroup.controllers"); err == nil {
info.Cgroup2 = true
// Unlike `docker info`, `podman info` does not print available cgroup controllers.
Expand Down

0 comments on commit c3b3e10

Please sign in to comment.