-
Notifications
You must be signed in to change notification settings - Fork 850
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 to merge complex commands when to inject commands #185
Conversation
Signed-off-by: cwen0 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #185 +/- ##
=========================================
Coverage ? 44.29%
=========================================
Files ? 18
Lines ? 675
Branches ? 0
=========================================
Hits ? 299
Misses ? 343
Partials ? 33 Continue to review full report at Codecov.
|
Signed-off-by: cwen0 <[email protected]>
Signed-off-by: cwen0 <[email protected]>
… fix_inject_scripts
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.
rest LGTM
Signed-off-by: cwen0 <[email protected]>
… fix_inject_scripts
pkg/utils/command.go
Outdated
|
||
scripts += cmd | ||
scripts += "\n" | ||
continue |
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.
emm, this continue is not necessary
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
Signed-off-by: cwen0 <[email protected]>
Signed-off-by: cwen0 <[email protected]>
please comments on documents? list the limitation of current implementation, Rest LGTM |
|
||
func isShellScripts(cmd string) bool { | ||
if cmd == "bash" || cmd == "sh" || | ||
strings.HasPrefix(cmd, "bash ") || strings.HasPrefix(cmd, "sh ") || |
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 not just strings.HasPrefix(cmd, "bash ") || strings.HasPrefix(cmd, "sh ")
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.
avoid some commands with prefix bash
or sh
, eg: shell2 xxx
pkg/utils/command.go
Outdated
} | ||
|
||
func mergeOriginCommandsAndArgs(origin []string, args []string) string { | ||
commands := []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.
commands := append(origin, args...)
Signed-off-by: cwen0 <[email protected]>
… fix_inject_scripts
@mahjonp @zhouqiang-cl @YangKeao @mapleFU PTAL again, thanks! |
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
Signed-off-by: cwen0 <[email protected]>
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
Signed-off-by: cwen0 <[email protected]>
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
Co-Authored-By: mahjonp <[email protected]>
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
…#185) * support to merge complex commands when to inject commands Signed-off-by: cwen0 <[email protected]>
Signed-off-by: cwen0 [email protected]
What problem does this PR solve?
fix #143
What is changed and how does it work?
eg:
Check List
Tests
log:
Code changes