mirror of
https://github.com/containers/podman.git
synced 2025-06-04 04:56:32 +08:00
rootless: show an error when pause/unpause are used
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1371 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
86aefb5de2
commit
d8c2962188
@ -32,6 +32,8 @@ var cmdsNotRequiringRootless = map[string]bool{
|
||||
"login": true,
|
||||
"logout": true,
|
||||
"kill": true,
|
||||
"pause": true,
|
||||
"unpause": true,
|
||||
"search": true,
|
||||
"stop": true,
|
||||
"top": true,
|
||||
|
@ -25,6 +25,10 @@ var (
|
||||
)
|
||||
|
||||
func pauseCmd(c *cli.Context) error {
|
||||
if os.Getuid() != 0 {
|
||||
return errors.New("pause is not supported for rootless containers")
|
||||
}
|
||||
|
||||
runtime, err := libpodruntime.GetRuntime(c)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not get runtime")
|
||||
|
@ -25,6 +25,10 @@ var (
|
||||
)
|
||||
|
||||
func unpauseCmd(c *cli.Context) error {
|
||||
if os.Getuid() != 0 {
|
||||
return errors.New("unpause is not supported for rootless containers")
|
||||
}
|
||||
|
||||
runtime, err := libpodruntime.GetRuntime(c)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not get runtime")
|
||||
|
Reference in New Issue
Block a user