-
Notifications
You must be signed in to change notification settings - Fork 72
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
[feat]curveadm: add export cmd for export the yaml that tools-v2 used #344
Conversation
Signed-off-by: Chengyu Liu <[email protected]>
update: wrong word spelling
Signed-off-by: ilixiaocui <[email protected]>
if err == nil { | ||
out = fmt.Sprintf("%s%s %s", key, delimiter, value) | ||
} else { // FIX : add replace warring log | ||
err = 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.
Why make the error 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.
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.
Maybe you can add a check before it, or talk it with your mentor or @Cyber-SiKu for a better approach.
61021f2
to
2f63acf
Compare
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
…ocker v24. Signed-off-by: Wine93 <[email protected]>
This reverts commit 0bff214. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
… local path. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: fengshunli <[email protected]> Signed-off-by: Wine93 <[email protected]>
Signed-off-by: fengshunli <[email protected]> Signed-off-by: Wine93 <[email protected]>
…ner. Signed-off-by: Cyber-SiKu <[email protected]> Signed-off-by: Wine93 <[email protected]>
…oolset. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
…urveadm's database (opencurve#206). Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
…r docker v24. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
… v24. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: montaguelhz <[email protected]>
Signed-off-by: Wine93 <[email protected]>
solution: execute the ss command in a temporary container to precheck for ports in use instead Signed-off-by: jyf111 <[email protected]>
Signed-off-by: Cyber-SiKu <[email protected]>
Signed-off-by: wanghai01 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: caoxianfei1 <[email protected]>
…ing. Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: wanghai01 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: caoxianfei1 <[email protected]>
Signed-off-by: caoxianfei1 <[email protected]>
Signed-off-by: zztaki <[email protected]>
cli/command/export.go
Outdated
|
||
var ( | ||
GET_EXPORT_PLAYBOOK_STEPS = []int{ | ||
playbook.SYNC_CONFIG, |
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.
Why need the step?
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.
Originally, I used it on the cluster I had started, and the conf in the container did not render successfully, so I added it, but now it seems that this step is really not needed, and I will restart this cluster later, and then test it.
) | ||
|
||
type exportOptions struct { | ||
output 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.
--path 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.
Okay, I'll make changes
) | ||
|
||
type exportOptions struct { | ||
output 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.
which one host to export? Specify host?
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 found that all hosts include curve.yaml. I think the conf in each host should be the same, so currently I have selected dcs[0], just like the implementation in the “status” command.
status.go
cli/command/export.go
Outdated
} else { | ||
pb.AddStep(&playbook.PlaybookStep{ | ||
Type: step, | ||
Configs: dcs, | ||
Options: map[string]interface{}{ | ||
comm.KEY_TOOLSV2_CONF_PATH: options.output, | ||
}, | ||
}) |
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.
Ditto.
if curveadm.IsSkip(dc) { | ||
return nil, nil | ||
} else if err != nil { | ||
return nil, err | ||
} else if len(containerId) == 0 { | ||
return nil, nil | ||
} else if containerId == comm.CLEANED_CONTAINER_ID { | ||
return nil, 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.
What does mean?
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 referred to the implementation of NewCollectService at that time, may be I need to evaluate whether it is necessary.
if err == nil { | ||
out = fmt.Sprintf("%s%s %s", key, delimiter, value) | ||
} else { // FIX : add replace warring log | ||
err = 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.
Ditto.
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.
Please refer to the discussion here. Perhaps I need to modify the logic of sync_config? Or is there any other more suitable method?
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.
Yes, if render failed, you can open another pull request to fix it.
BTW, please push it to develop branch again. |
Signed-off-by: zztaki <[email protected]>
2f63acf
to
9d83a9c
Compare
Signed-off-by: Liao PengFei <[email protected]>
Signed-off-by: WhereAreBugs <[email protected]>
Signed-off-by: WhereAreBugs <[email protected]>
Fixed: #315
add export cmd for export the yaml that tools-v2 used