From ccb2608dd5e4cf145902d4f9b3d2962b5c0005e3 Mon Sep 17 00:00:00 2001 From: NewGr8Player <273221594@qq.com> Date: Mon, 31 Aug 2020 10:49:16 +0800 Subject: [PATCH] refactor(autok3s): create and join flag refactor --- cmd/create.go | 5 ++++- cmd/join.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/create.go b/cmd/create.go index eef9e562..b4a05070 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -31,7 +31,10 @@ func init() { createCmd.Flags().StringVarP(&cProvider, "provider", "p", cProvider, "Provider is a module which provides an interface for managing cloud resources") createCmd.Flags().StringVar(&cSSH.User, "ssh-user", cSSH.User, "SSH user for host") createCmd.Flags().StringVar(&cSSH.Port, "ssh-port", cSSH.Port, "SSH port for host") - createCmd.Flags().StringVar(&cSSH.SSHKey, "ssh-key", cSSH.SSHKey, "SSH private key path") + createCmd.Flags().StringVar(&cSSH.SSHKeyPath, "ssh-key-path", cSSH.SSHKeyPath, "SSH private key path") + createCmd.Flags().StringVar(&cSSH.SSHKeyPassphrase, "ssh-key-pass", cSSH.SSHKeyPassphrase, "Passphrase of SSH private key") + createCmd.Flags().StringVar(&cSSH.SSHCertPath, "ssh-key-cert-path", cSSH.SSHCertPath, "SSH private key certificate path") + createCmd.Flags().StringVar(&cSSH.Password, "ssh-password", cSSH.Password, "SSH login password") } func CreateCommand() *cobra.Command { diff --git a/cmd/join.go b/cmd/join.go index b0c1e544..c7cd395e 100644 --- a/cmd/join.go +++ b/cmd/join.go @@ -31,7 +31,10 @@ func init() { joinCmd.Flags().StringVarP(&jProvider, "provider", "p", jProvider, "Provider is a module which provides an interface for managing cloud resources") joinCmd.Flags().StringVar(&jSSH.User, "ssh-user", jSSH.User, "SSH user for host") joinCmd.Flags().StringVar(&jSSH.Port, "ssh-port", jSSH.Port, "SSH port for host") - joinCmd.Flags().StringVar(&jSSH.SSHKey, "ssh-key", jSSH.SSHKey, "SSH private key path") + joinCmd.Flags().StringVar(&jSSH.SSHKeyPath, "ssh-key-path", jSSH.SSHKeyPath, "SSH private key path") + joinCmd.Flags().StringVar(&jSSH.SSHKeyPassphrase, "ssh-key-pass", jSSH.SSHKeyPassphrase, "Passphrase of SSH private key") + joinCmd.Flags().StringVar(&jSSH.SSHCertPath, "ssh-key-cert-path", jSSH.SSHCertPath, "SSH private key certificate path") + joinCmd.Flags().StringVar(&jSSH.Password, "ssh-password", jSSH.Password, "SSH login password") } func JoinCommand() *cobra.Command {