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:
Giuseppe Scrivano
2018-08-29 10:24:50 +02:00
committed by Atomic Bot
parent 86aefb5de2
commit d8c2962188
3 changed files with 10 additions and 0 deletions

View File

@ -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,

View File

@ -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")

View File

@ -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")