Skip to content

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

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Cluster Debug #1792

merged 1 commit into from
Sep 26, 2022

Conversation

HURUIZHE
Copy link
Collaborator

Signed-off-by: HURUIZHE [email protected]

@HURUIZHE HURUIZHE force-pushed the sealos branch 2 times, most recently from 4abdfd6 to 98c8d81 Compare September 24, 2022 08:30
@HURUIZHE
Copy link
Collaborator Author

why

@HURUIZHE HURUIZHE force-pushed the sealos branch 2 times, most recently from eef83b0 to 2e7c8ed Compare September 25, 2022 03:34
@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Base: 57.94% // Head: 57.94% // No change to project coverage 👍

Coverage data is based on head (5d5487b) compared to base (5ed02d2).
Patch has no changes to coverable lines.

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zzjin
Copy link
Collaborator

zzjin commented Sep 25, 2022

Check the linter error at:

  Running [/home/runner/golangci-lint-1.49.0-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=./controllers/infra --out-${NO_FUTURE}format colored-line-number] in [/home/runner/work/sealos/sealos/controllers/infra] ...
  controllers/infra/drivers/reconcile_test.go:4: File is not `goimports`-ed (goimports)
  	"github.com/labring/sealos/pkg/types/v1beta1"

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)
Copy link
Member

@fanux fanux Sep 25, 2022

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

Copy link
Collaborator Author

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 {
Copy link
Member

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

Copy link
Collaborator Author

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: " ")

Copy link
Collaborator Author

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, "")
Copy link
Member

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")...

Copy link
Collaborator Author

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//,/ })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

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
Copy link
Member

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator Author

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
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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

@HURUIZHE HURUIZHE force-pushed the sealos branch 4 times, most recently from b06b2f8 to 5c240c0 Compare September 26, 2022 04:27
Signed-off-by: HURUIZHE <[email protected]>
@fanux fanux merged commit 879164f into labring:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants