Merge pull request #29832 from NyCodeGHG/push-nmxtvwwnwuvm

Move cgroup check below help/completion/subcommands check
This commit is contained in:
Giuseppe Scrivano 2026-09-25 15:25:50 +02:00 • committed by GitHub
commit 98c52cf8d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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() {