-
Notifications
You must be signed in to change notification settings - Fork 816
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: chaosctl for print debug info #1074
Conversation
|
Codecov Report
@@ Coverage Diff @@
## master #1074 +/- ##
==========================================
- Coverage 55.78% 53.43% -2.35%
==========================================
Files 68 83 +15
Lines 4383 5225 +842
==========================================
+ Hits 2445 2792 +347
- Misses 1768 2165 +397
- Partials 170 268 +98
Continue to review full report at Codecov.
|
|
Signed-off-by: yiyiyimu <wosoyoung@gmail.com> add cobra based CTL Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
ffa4d24
to
1baed24
Compare
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
…o network-debug
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
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.
It seems that you have misunderstood programming on kubernetes. I will talk with you in detail 😢
…tput Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
pkg/chaosctl/cmd/debug.go
Outdated
} | ||
|
||
func flagCompletion(cmd *cobra.Command) error { | ||
k8sConfig, err := config.GetConfig() |
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.
Would be good to switch to https://github.com/kubernetes/cli-runtime and use its factory to initialize the k8s config and client.
This supports more kubectl options like --context
, --server
by default.
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.
Sure I'll try to only use one type of client
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
…Json Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
…o network-debug
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
…o network-debug
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
pkg/chaosctl/common/exec.go
Outdated
// we need to enter mount namespace to get file related infomation | ||
// but enter mnt ns would prevent us to access `cat`/`ls` in daemon | ||
// so use `nsexec` to achieve using nsenter and cat together | ||
newCmd := fmt.Sprintf("/usr/local/bin/nsexec %s %s", strconv.Itoa(pid), cmd) |
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 came up with a better idea to implement a more general nsexec
🍻 . You can find the source code and documents at https://github.com/YangKeao/nsexec, and it will be brought to chaos-daemon
in #1260 .
I don't know whether it's a big project to migrate to YangKeao/nsexec.
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.
Cool I test it and it works fine. I'll commit the change till #1260 got merged.
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.
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
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
Thanks for your contribution @Yiyiyimu!
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
It finally arrives! (Maybe we need a document later 😺 ) 🍻
/merge |
/run-all-tests |
cherry pick to release-1.0 failed |
Is there have readme about this tool? @Yiyiyimu |
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu wosoyoung@gmail.com
What's this PR did
fix #694
Checklist
SUPPORT CHAOS
DEBUG
ls
,ps
andcat
chaosctl logs
CTL
chaosctl debug xxxchaos CHAOSNAME -n NAMESPACE