summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-06-03 13:36:39 -0500
committerMatthew Heon <mheon@redhat.com>2020-06-24 14:41:00 -0400
commitf81ad0058c684879af0f5e2c26e120013ac335aa (patch)
treed2a0824b3acc500f8563ced5e98ea9b556f6474d /cmd/podman
parentcd0b18c24f9835e8bb258b906800f0975fbe9e2f (diff)
downloadpodman-f81ad0058c684879af0f5e2c26e120013ac335aa.tar.gz
podman-f81ad0058c684879af0f5e2c26e120013ac335aa.tar.bz2
podman-f81ad0058c684879af0f5e2c26e120013ac335aa.zip
wip
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/system/connection.go54
1 files changed, 54 insertions, 0 deletions
diff --git a/cmd/podman/system/connection.go b/cmd/podman/system/connection.go
new file mode 100644
index 000000000..3af905fad
--- /dev/null
+++ b/cmd/podman/system/connection.go
@@ -0,0 +1,54 @@
+// +build !remote
+
+package system
+
+import (
+ "github.com/containers/libpod/cmd/podman/registry"
+ "github.com/containers/libpod/pkg/domain/entities"
+ "github.com/spf13/cobra"
+)
+
+var (
+ connectionDescription = `TBD
+`
+ connectionCommand = &cobra.Command{
+ Use: "connection",
+ //Args: validate.NoArgs,
+ Long: connectionDescription,
+ Short: "Add remote ssh connection",
+ RunE: connection,
+ Example: `podman system connection server.foobar.com
+podman system connection --identity ~/.ssh/dev_rsa --default root@server.foobar.com:222`,
+ }
+)
+
+var connectionOptions = struct {
+ Alias string
+ Default bool
+ Identity string
+ SocketPath string
+ User string
+}{}
+
+func init() {
+ registry.Commands = append(registry.Commands, registry.CliCommand{
+ Mode: []entities.EngineMode{entities.ABIMode},
+ Command: connectionCommand,
+ Parent: systemCmd,
+ })
+ flags := connectionCommand.Flags()
+ flags.StringVar(&connectionOptions.Alias, "alias", "", "alias name for connection")
+ flags.BoolVar(&connectionOptions.Default, "default", false, "set as the default connection")
+ flags.StringVar(&connectionOptions.Identity, "identity", "", "path to ssh identity file")
+ //flags.StringVar(&connectionOptions.User, "user", "", "remote username")
+ flags.StringVar(&connectionOptions.SocketPath, "socket-path", "", "path to podman socket on remote host")
+}
+
+func connection(cmd *cobra.Command, args []string) error {
+ // if no user is provided, assume local user name
+ // if no socket is provided, then do an ssh to look for it
+ // default connection, if exists, is then assumed with podman remote
+ // if no identity exists, should we be prompting for password?
+
+ return nil
+}