-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Fixed kubectl cluster-info dump
to support multi-container pod.
#44088
Conversation
Hi @xingzhou. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
I think the patch does a good job of handling the multi-container case for a pod, but it seems like it might be better if an error talking to a single container didn't abort the whole cluster info dump. We're using this command in the case where we're attempting to understand a problem, so gathering as much info as possible has significant value. |
/assign @adohe |
sounds reasonable to me. @xingzhou could you please help improve this? |
Sure, @chrisegner and @adohe, let me update the patch |
Have updated code to be tolerant on the container log request error, dears, please take a look at the latest patch, thanks! |
pkg/kubectl/cmd/clusterinfo_dump.go
Outdated
if err != nil { | ||
// Print error and carry on dumping other pods info. | ||
writer.Write([]byte(fmt.Sprintf("Request log error: %s\n", err.Error()))) | ||
writer.Write([]byte(endMsg)) |
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.
How about turning this loop body into a function and use defer
for printing that message? This will ensure we have it printed always, esp. when introducing new branches here.
Fixed `kubectl cluster-info dump` to support multi-container pod.
thanks @soltysh for your time, please take a look at the latest update |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adohe, soltysh, xingzhou
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@xingzhou just get time to review this, thanks for this. |
Automatic merge from submit-queue |
Fixed
kubectl cluster-info dump
to support multi-container pod.Release note:
Fixed #44069