From 7cef788844bdaae01ca672a55698d40428644eb4 Mon Sep 17 00:00:00 2001 From: Marie Ramlow Date: Thu, 24 Sep 2026 18:49:56 +0200 Subject: [PATCH] Move cgroup check below help/completion/subcommands check NixOS builds podman inside a sandbox and uses the `podman completion` subcommand. While upgrading to Podman 6, we noticed that this command now started failing in our build sandbox because of the cgroup check. The cgroups are not relevant to completion generation. Signed-off-by: Marie Ramlow --- cmd/podman/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 7a4e313c84..ffda5c42a3 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -266,8 +266,6 @@ func setupRemoteConnection(podmanConfig *entities.PodmanConfig) string { func persistentPreRunE(cmd *cobra.Command, args []string) error { logrus.Debugf("Called %s.PersistentPreRunE(%s)", cmd.Name(), strings.Join(os.Args, " ")) - checkSupportedCgroups() - // Help, completion and commands with subcommands are special cases, no need for more setup // Completion cmd is used to generate the shell scripts if cmd.Name() == "help" || cmd.Name() == "completion" || cmd.HasSubCommands() { @@ -275,6 +273,8 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error { return nil } + checkSupportedCgroups() + podmanConfig := registry.PodmanConfig() if !registry.IsRemote() {