From c3b3e10f6000d682415edd07e2ec076ef644b695 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Tue, 18 May 2021 09:49:09 +0200 Subject: [PATCH] detect remote podman Co-authored-by: Andrea Frittoli --- pkg/cluster/internal/providers/podman/provider.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cluster/internal/providers/podman/provider.go b/pkg/cluster/internal/providers/podman/provider.go index e6ec5bd806..bb753fd519 100644 --- a/pkg/cluster/internal/providers/podman/provider.go +++ b/pkg/cluster/internal/providers/podman/provider.go @@ -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.