mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #3477 from ashley-cui/pauserootless
Fix rootless detection error for pause & unpause
This commit is contained in:
@ -1,11 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/containers/libpod/cmd/podman/cliconfig"
|
"github.com/containers/libpod/cmd/podman/cliconfig"
|
||||||
"github.com/containers/libpod/libpod/define"
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/pkg/adapter"
|
"github.com/containers/libpod/pkg/adapter"
|
||||||
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -39,7 +38,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pauseCmd(c *cliconfig.PauseValues) error {
|
func pauseCmd(c *cliconfig.PauseValues) error {
|
||||||
if os.Geteuid() != 0 {
|
if rootless.IsRootless() && !remoteclient {
|
||||||
return errors.New("pause is not supported for rootless containers")
|
return errors.New("pause is not supported for rootless containers")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/containers/libpod/cmd/podman/cliconfig"
|
"github.com/containers/libpod/cmd/podman/cliconfig"
|
||||||
"github.com/containers/libpod/libpod/define"
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/pkg/adapter"
|
"github.com/containers/libpod/pkg/adapter"
|
||||||
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -38,7 +37,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func unpauseCmd(c *cliconfig.UnpauseValues) error {
|
func unpauseCmd(c *cliconfig.UnpauseValues) error {
|
||||||
if os.Geteuid() != 0 {
|
if rootless.IsRootless() && !remoteclient {
|
||||||
return errors.New("unpause is not supported for rootless containers")
|
return errors.New("unpause is not supported for rootless containers")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user