Skip to content
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

🌱 test/framework: improve logging of RunErrors occurring when bootstrap cluster creation fails #5908

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Jan 5, 2022

Signed-off-by: Stefan Büringer buringerst@vmware.com

What this PR does / why we need it:
This PR improves logging, so that RunErrors occurring when bootstrap cluster creation fails are readable.

This makes it possible to read not only the errors on the triage PR, but also the ones occurring in our periodics.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

…cluster

creation fails

Signed-off-by: Stefan Büringer buringerst@vmware.com
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 5, 2022
@sbueringer
Copy link
Member Author

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 5, 2022
@sbueringer
Copy link
Member Author

/test pull-cluster-api-verify-main

3 similar comments
@sbueringer
Copy link
Member Author

/test pull-cluster-api-verify-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-verify-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-verify-main

@sbueringer
Copy link
Member Author

Giving up for now, unable to get the job to run on a non-broken node in the Prow cluster.

@sbueringer
Copy link
Member Author

/test pull-cluster-api-verify-main
/test pull-cluster-api-e2e-full-main

// Extract the details of the RunError, if the cluster creation was triggered by a RunError.
var runErr *exec.RunError
if errors.As(err, &runErr) {
errStr += "\n" + string(runErr.Output)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to append RunError.Inner error as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but I wouldn't add it as it's already part of the err, i.e.:

  • err looks like this Failed to create kind cluster "test-lt3j5f-5": failed to init node with kubeadm: command "docker exec --privileged test-lt3j5f-5-control-plane kubeadm init --skip-phases=preflight --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1

  • the inner error would be command "docker exec --privileged test-lt3j5f-5-control-plane kubeadm init --skip-phases=preflight --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1

@enxebre
Copy link
Member

enxebre commented Jan 5, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 5, 2022
@fabriziopandini
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2022
@k8s-ci-robot k8s-ci-robot merged commit ff0c435 into kubernetes-sigs:main Jan 7, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Jan 7, 2022
@sbueringer sbueringer deleted the pr-impr-bootstrap-cluster-creation-logging branch January 7, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants