-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix kind export logs #2161
fix kind export logs #2161
Conversation
BenTheElder
commented
Mar 26, 2021
- export kind-version.txt at the top level, instead of per node. it's not a property of the node
- always print the exported path so any logs that are exported can be debugged even if an error is encountered
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind bug |
partial logs will still have been exported
63f4dcb
to
7f4dc38
Compare
logger.V(0).Infof("Exported logs for cluster %q to:", flags.Name) | ||
// NOTE: the path is the output of this command to be captured by calling tools | ||
// whereas "Exporting logs..." is info / debug (stderr) | ||
logger.V(0).Infof("Exporting logs for cluster %q to:", flags.Name) |
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.
to: %s", dir) ??
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.
no, we print the path to stdout for capture by the calling program.
we print the message to stderr.
(see the comment above)
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.
e.g.:
$ kind export logs
Exporting logs for cluster "kind" to:
/private/var/folders/rt/xdpktcmj0p7fx3kvwmrgdqyh00fsfv/T/609940926
ERROR: [command "docker exec --privileged kind-control-plane sh -c 'tar --hard-dereference -C /var/log/ -chf - . || (r=$?; [ $r -eq 1 ] || exit $r)'" failed with error: exit status 1, [command "docker exec --privileged kind-control-plane cat /kind/version" failed with error: exit status 1, command "docker exec --privileged kind-control-plane journalctl --no-pager -u kubelet.service" failed with error: exit status 1, command "docker exec --privileged kind-control-plane journalctl --no-pager -u containerd.service" failed with error: exit status 1, command "docker exec --privileged kind-control-plane journalctl --no-pager" failed with error: exit status 1]]
the stdout part is /private/var/folders/rt/xdpktcmj0p7fx3kvwmrgdqyh00fsfv/T/609940926
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.
note: in this commit I basically just moved this up before we actually export (so if we hit an error you can still see where the logs we did collect are) and s/Exported/Exporting/
/lgtm |