-
Notifications
You must be signed in to change notification settings - Fork 362
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
support default HostIp #1791
support default HostIp #1791
Conversation
22a0e9d
to
797cc3e
Compare
pkg/infradriver/ssh_infradriver.go
Outdated
if d.clusterEnv["RegistryDomain"] == nil { | ||
d.clusterEnv["RegistryDomain"] = "sea.hub" | ||
} | ||
if d.clusterEnv["RegistryPort"] == nil { |
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.
use if ok to check its map key, and add more code comments.
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.
Attention UT.
pkg/infradriver/ssh_infradriver.go
Outdated
} | ||
|
||
func (d *SSHInfraDriver) GetClusterEnv() map[string]interface{} { | ||
return d.clusterRenderData | ||
if _, ok := d.clusterEnv["RegistryDomain"]; !ok { | ||
d.clusterEnv["RegistryDomain"] = "sea.hub" |
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.
Strings like "sea.hub", "5000", should be consts and put into well known common file.
pkg/infradriver/ssh_infradriver.go
Outdated
@@ -141,11 +142,21 @@ func (d *SSHInfraDriver) GetHostIPListByRole(role string) []net.IP { | |||
} | |||
|
|||
func (d *SSHInfraDriver) GetHostEnv(host net.IP) map[string]interface{} { | |||
return d.hostEnvMap[host.String()] | |||
hostEnv := d.hostEnvMap[host.String()] | |||
if _, ok := hostEnv["HostIP"]; !ok { |
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.
Keys like "HostIP" should be a const and put it into well known common file
Codecov ReportBase: 20.66% // Head: 20.81% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1791 +/- ##
==========================================
+ Coverage 20.66% 20.81% +0.14%
==========================================
Files 71 71
Lines 6542 6558 +16
==========================================
+ Hits 1352 1365 +13
- Misses 5009 5012 +3
Partials 181 181
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ead06f2
to
9bfb8b6
Compare
reference and set constants; add comments
9bfb8b6
to
d1db1f3
Compare
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
Describe what this PR does / why we need it
#1787
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews