-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cluster Debug #1792
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
Cluster Debug #1792
Conversation
4abdfd6
to
98c8d81
Compare
why |
eef83b0
to
2e7c8ed
Compare
Codecov ReportBase: 57.94% // Head: 57.94% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1792 +/- ##
=======================================
Coverage 57.94% 57.94%
=======================================
Files 6 6
Lines 478 478
=======================================
Hits 277 277
Misses 184 184
Partials 17 17 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. |
Check the linter error at:
|
fmt.Println("sudo sh masterDepl.sh master0 " + passwd + " " + ipMasters + " " + ipNodes) | ||
//todo Add images | ||
err = ssh.CmdAsync(sealos, "sudo sh masterDepl.sh master0 "+passwd+" "+ipMasters+" "+ipNodes, "") | ||
fmt.Println("sudo sh masterDepl.sh master0 " + passwd + " " + ipMasters + " " + ipNodes + " " + images) |
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 log instead fmt.println
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.
ok
return nil | ||
} | ||
|
||
func getImages(cluster *cv1.Cluster) string { | ||
images := "" | ||
for _, image := range cluster.Spec.Images { | ||
images = images + image + " " | ||
for i, image := range cluster.Spec.Images { |
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.
I don't quite understand why need this
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.
array -> string(as parameter; split:",") -> array(in shell) -> string(split: " ")
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.
here: array->string, to be parameter
fmt.Println("sudo sh " + fileName + " master " + passwd) | ||
err := ssh.CmdAsync(ip, "sudo sh "+fileName+" master "+passwd, "") | ||
fmt.Println("sudo sh " + fileName + " master " + passwd + " " + images) | ||
err := ssh.CmdAsync(ip, "sudo sh "+fileName+" master "+passwd+" "+images, "") |
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.
fmt.Sprintf("sudo sh %s master %s")...
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.
ok
@@ -3,12 +3,20 @@ role=$1 | |||
password=$2 | |||
ipmasters=$3 | |||
ipnodes=$4 | |||
string=$5 | |||
array=(${string//,/ }) |
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.
?
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.
images parameter. Modified
@@ -8,5 +8,5 @@ type Price struct { | |||
// QueryPrice query infra price/hour | |||
func (pReq Price) QueryPrice(infra *v1.Infra) (int64, error) { | |||
//TODO implement me | |||
panic("implement me") | |||
return 1, 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.
func (infra *v1.Infra) QueryPrice() (int64, error) is better?
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.
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.
this function completed
@@ -3,12 +3,20 @@ role=$1 | |||
password=$2 | |||
ipmasters=$3 | |||
ipnodes=$4 |
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.
using go template is better ?
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.
todo: use name instead of number
b06b2f8
to
5c240c0
Compare
Signed-off-by: HURUIZHE <[email protected]>
Signed-off-by: HURUIZHE [email protected]