-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add kcctl conection port configurable #207
Conversation
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
cmd/kcctl/app/options/options.go
Outdated
@@ -65,6 +65,7 @@ const ( | |||
DefaultDeployConfig = "deploy-config.yaml" | |||
DefaultConfig = "config" | |||
DefaultCaPath = "pki" | |||
DefaultSSHPort = 22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnessasery
cmd/kcctl/app/options/options.go
Outdated
@@ -268,6 +269,7 @@ func NewDeployOptions() *DeployConfig { | |||
IPDetect: autodetection.MethodFirst, | |||
SSHConfig: &sshutils.SSH{ | |||
User: "root", | |||
Port: DefaultSSHPort, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
22
cmd/kcctl/app/options/options.go
Outdated
if c.Config == "" { | ||
return nil | ||
} | ||
|
||
if c.SSHConfig.Port != DefaultSSHPort { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnessasery
cmd/kcctl/app/options/options.go
Outdated
@@ -308,9 +310,15 @@ func (c *DeployConfig) MergeDeployOptions() { | |||
} | |||
|
|||
func (c *DeployConfig) Complete() error { | |||
port := 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnessasery, just check port > 0 in func ValidateArgs
cmd/kcctl/app/options/options.go
Outdated
@@ -338,6 +346,12 @@ func (c *DeployConfig) Complete() error { | |||
} | |||
} | |||
|
|||
if port != 0 { | |||
c.SSHConfig.Port = port | |||
} else if c.SSHConfig.Port == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnessasery
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
/cc @lixd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 1b847426d669ac6e5cfddcd6c7dcb79b0cfd8261
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lixd, Metrora, x893675 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Liucw liu.chuwei@99cloud.net
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #191
Special notes for reviewers:
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.:
@x893675