diff options
author | baude <bbaude@redhat.com> | 2019-04-07 10:04:44 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-04-10 12:43:19 -0500 |
commit | 7f10672486086c5a7a123bfa0d3edb23fa5b1c9f (patch) | |
tree | b92c8abcca67cdc1d1a2f56769bae89deffe3b3d /cmd/podman/main_remote.go | |
parent | 1fb0a09591ae86b659dc87bd9e3f7fe29d8add8d (diff) | |
download | podman-7f10672486086c5a7a123bfa0d3edb23fa5b1c9f.tar.gz podman-7f10672486086c5a7a123bfa0d3edb23fa5b1c9f.tar.bz2 podman-7f10672486086c5a7a123bfa0d3edb23fa5b1c9f.zip |
Initial remote flag clean up
The remote client should not honor most of the local podman "global"
options. Many of them are only applicable to where the podman backend
is actually running.
Also, removing some options for push and pull that also are not
applicable to the remote client environment.
Additionally, take some of the code from main and pop it into functions
that can be called whether local or not. This helps the remote client
and darwin builds.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/main_remote.go')
-rw-r--r-- | cmd/podman/main_remote.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cmd/podman/main_remote.go b/cmd/podman/main_remote.go new file mode 100644 index 000000000..2a7d184cd --- /dev/null +++ b/cmd/podman/main_remote.go @@ -0,0 +1,43 @@ +// +build remoteclient + +package main + +import ( + "os" + + "github.com/containers/libpod/pkg/rootless" + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" +) + +const remote = true + +func init() { + // remote client specific flags can go here. +} + +func setSyslog() error { + return nil +} + +func profileOn(cmd *cobra.Command) error { + return nil +} + +func profileOff(cmd *cobra.Command) error { + return nil +} + +func setupRootless(cmd *cobra.Command, args []string) error { + if rootless.IsRootless() { + became, ret, err := rootless.BecomeRootInUserNS() + if err != nil { + logrus.Errorf(err.Error()) + os.Exit(1) + } + if became { + os.Exit(ret) + } + } + return nil +} |