diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-19 10:24:06 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-19 15:01:53 +0100 |
commit | ab576e8577b6cc95aebf4afb84d104cb74ea8717 (patch) | |
tree | f86d4f8134db1e7a3add3b7aefddc153e4e602f0 /cmd/podman/pod_restart.go | |
parent | ffc08860ce809effa7570e761f97f26267008bfe (diff) | |
download | podman-ab576e8577b6cc95aebf4afb84d104cb74ea8717.tar.gz podman-ab576e8577b6cc95aebf4afb84d104cb74ea8717.tar.bz2 podman-ab576e8577b6cc95aebf4afb84d104cb74ea8717.zip |
rootless: implement pod restart
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/pod_restart.go')
-rw-r--r-- | cmd/podman/pod_restart.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/podman/pod_restart.go b/cmd/podman/pod_restart.go index 0765b98db..9c8d28424 100644 --- a/cmd/podman/pod_restart.go +++ b/cmd/podman/pod_restart.go @@ -2,9 +2,11 @@ package main import ( "fmt" + "os" "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/pkg/adapter" + "github.com/containers/libpod/pkg/rootless" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -46,12 +48,24 @@ func init() { func podRestartCmd(c *cliconfig.PodRestartValues) error { var lastError error + if os.Geteuid() != 0 { + rootless.SetSkipStorageSetup(true) + } runtime, err := adapter.GetRuntime(&c.PodmanCommand) if err != nil { return errors.Wrapf(err, "could not get runtime") } defer runtime.Shutdown(false) + if rootless.IsRootless() { + var err error + + c.InputArgs, c.All, c.Latest, err = joinPodNS(runtime, c.All, c.Latest, c.InputArgs) + if err != nil { + return err + } + } + restartIDs, conErrors, restartErrors := runtime.RestartPods(getContext(), c) for _, p := range restartIDs { |