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

🌱 Improve output of exec.KubectlApply #9737

Merged

Conversation

sbueringer
Copy link
Member

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

What this PR does / why we need it:

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 #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 20, 2023
Signed-off-by: Stefan Büringer buringerst@vmware.com
@sbueringer sbueringer added the area/e2e-testing Issues or PRs related to e2e testing label Nov 20, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-area PR is missing an area label size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 20, 2023
@sbueringer
Copy link
Member Author

/assign @fabriziopandini @chrischdi

test/framework/clusterctl/client.go Show resolved Hide resolved
test/framework/clusterctl/client.go Show resolved Hide resolved
@chrischdi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fc2f0d8ad5ee20aaf45909951c100806a4421f72

@sbueringer
Copy link
Member Author

/assign @fabriziopandini

Comment on lines -124 to +125
return errors.Wrapf(err, "failed to read input file %q", f)
return pkgerrors.Wrapf(err, "failed to read input file %q", f)
Copy link
Member

Choose a reason for hiding this comment

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

While we're here, should we move these to be fmt.Errorf instead?

Copy link
Member Author

@sbueringer sbueringer Nov 22, 2023

Choose a reason for hiding this comment

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

Not sure if I got your question correctly.

I think as of today github.com/pkg/errors is still the standard in CAPI that we use everywhere to create and wrap errors. Are you asking to use the Go SDK funcs instead? If yes, I would defer that to a separate issue / PR / discussion around if we want to migrate away from pkg/errors.

Related: Previously closed issue around migrating away from pkg/errors: #6688

Copy link
Member Author

@sbueringer sbueringer Nov 22, 2023

Choose a reason for hiding this comment

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

Merged this PR for now as we would like to use it to debug e2e tests. Happy to continue the conversation and follow-up accordingly

Copy link
Member

Choose a reason for hiding this comment

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

The packages are compatibile with each other, especially the wrap/unwrap; we could just use those going forward

Copy link
Member Author

@sbueringer sbueringer Dec 4, 2023

Choose a reason for hiding this comment

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

Isn't there a difference in the amount of information they store in the errors? (pkg/errors stores the entire stacktrace which then gets logged if JSON logging is used)

(we should probably move this discussion to an issue, so others see it as well)

@fabriziopandini
Copy link
Member

/lgtm
/approve

+1 to have the discussion on fmt.error on a separated thread

@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 Nov 22, 2023
@k8s-ci-robot k8s-ci-robot merged commit 806b10f into kubernetes-sigs:main Nov 22, 2023
22 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Nov 22, 2023
@sbueringer
Copy link
Member Author

/cherry-pick release-1.6

(we also want this on other branches to ease debugging there)

@sbueringer
Copy link
Member Author

/cherry-pick release-1.5

@sbueringer
Copy link
Member Author

/cherry-pick release-1.4

@sbueringer sbueringer deleted the pr-improve-apply-output branch November 22, 2023 13:38
@k8s-infra-cherrypick-robot

@sbueringer: #9737 failed to apply on top of branch "release-1.5":

Applying: Improve output of exec.KubectlApply
Using index info to reconstruct a base tree...
M	cmd/clusterctl/cmd/topology_plan.go
M	test/framework/cluster_proxy.go
M	test/framework/clusterctl/client.go
Falling back to patching base and 3-way merge...
Auto-merging test/framework/clusterctl/client.go
Auto-merging test/framework/cluster_proxy.go
Auto-merging cmd/clusterctl/cmd/topology_plan.go
CONFLICT (content): Merge conflict in cmd/clusterctl/cmd/topology_plan.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Improve output of exec.KubectlApply
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.5

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.

@k8s-infra-cherrypick-robot

@sbueringer: #9737 failed to apply on top of branch "release-1.4":

Applying: Improve output of exec.KubectlApply
Using index info to reconstruct a base tree...
M	cmd/clusterctl/cmd/topology_plan.go
M	test/framework/cluster_proxy.go
M	test/framework/clusterctl/client.go
Falling back to patching base and 3-way merge...
Auto-merging test/framework/clusterctl/client.go
Auto-merging test/framework/cluster_proxy.go
Auto-merging cmd/clusterctl/cmd/topology_plan.go
CONFLICT (content): Merge conflict in cmd/clusterctl/cmd/topology_plan.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Improve output of exec.KubectlApply
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.4

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.

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #9761

In response to this:

/cherry-pick release-1.6

(we also want this on other branches to ease debugging there)

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.

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. area/e2e-testing Issues or PRs related to e2e testing 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants