diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-18 21:12:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 21:12:04 +0200 |
commit | 8133aa1ee88cea2c89d38c1c56974c8889ef0933 (patch) | |
tree | 95e2cbc29508cd9e40d5bbee200f83fbc4ad1747 /cmd/podman/main_remote.go | |
parent | 2c51d6f800a1ed472da3b88b4f987ab73953c8d0 (diff) | |
parent | 0d9b952aeab95c59b28bcea42f719d06363b45b5 (diff) | |
download | podman-8133aa1ee88cea2c89d38c1c56974c8889ef0933.tar.gz podman-8133aa1ee88cea2c89d38c1c56974c8889ef0933.tar.bz2 podman-8133aa1ee88cea2c89d38c1c56974c8889ef0933.zip |
Merge pull request #4041 from baude/remoteconfigport
support non-standard ssh port for remote-client
Diffstat (limited to 'cmd/podman/main_remote.go')
-rw-r--r-- | cmd/podman/main_remote.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/main_remote.go b/cmd/podman/main_remote.go index a005e925c..f617422e6 100644 --- a/cmd/podman/main_remote.go +++ b/cmd/podman/main_remote.go @@ -3,6 +3,7 @@ package main import ( + "github.com/pkg/errors" "os/user" "github.com/spf13/cobra" @@ -18,6 +19,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&MainGlobalOpts.ConnectionName, "connection", "", "remote connection name") rootCmd.PersistentFlags().StringVar(&MainGlobalOpts.RemoteConfigFilePath, "remote-config-path", "", "alternate path for configuration file") rootCmd.PersistentFlags().StringVar(&MainGlobalOpts.RemoteUserName, "username", username, "username on the remote host") + rootCmd.PersistentFlags().IntVar(&MainGlobalOpts.Port, "port", 22, "port on remote host") rootCmd.PersistentFlags().StringVar(&MainGlobalOpts.RemoteHost, "remote-host", "", "remote host") // TODO maybe we allow the altering of this for bridge connections? // rootCmd.PersistentFlags().StringVar(&MainGlobalOpts.VarlinkAddress, "varlink-address", adapter.DefaultAddress, "address of the varlink socket") @@ -42,3 +44,11 @@ func setRLimits() error { } func setUMask() {} + +// checkInput can be used to verify any of the globalopt values +func checkInput() error { + if MainGlobalOpts.Port < 0 || MainGlobalOpts.Port > 65536 { + return errors.Errorf("remote port must be between 0 and 65536") + } + return nil +} |