Until go 2.0 is out and/or until the code base transitions to the updates in error handling it has, a suggested change discussed in the recent Zoom meeting is to replace the usage of the construct fmt.Errorf() in favor of the wrappers available in the package pkg/errors
a github search reveals:
https://github.com/kubernetes-sigs/cluster-api/search?q=%22fmt.Errorf%22&unscoped_q=%22fmt.Errorf%22
/kind cleanup
/priority backlog
/help
@neolit123:
This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
Until go 2.0 is out and/or until the code base transitions to the updates in error handling it has, a suggested change discussed in the recent Zoom meeting is to replace the usage of the construct
fmt.Errorf()in favor of the wrappers available in the package pkg/errorsa github search reveals:
https://github.com/kubernetes-sigs/cluster-api/search?q=%22fmt.Errorf%22&unscoped_q=%22fmt.Errorf%22/kind cleanup
/priority backlog
/help
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.
/good-first-issue
@neolit123:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
/good-first-issue
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'm not convinced on this:
pkg is not an official offering from the go team, AIUI pkg is not an official offering from the go team, AIUI
true. that was my only concern i raised to @timothysc when we did the same in kubeam.
there is an official solution for errors coming in / under consideration for go2
pkg/errors is in maintenance mode because of go2's error work
doing something that isn't fmt.Errorf might make the transition harder
but the new go error handling will require changes regardless if we use the stdlib errors or pkg/errors.
if we wanted to do something before go2 (which I don't think we should), we should probably actively design it - e.g. klog integration.
i think it's ok to bubble an error in the call stack and then log it with klog, but i don't think we should use klog as a replacement for fmt.Errorf(), errrors.New.
I wrote up a document about this already https://docs.google.com/document/d/1-A96l08u0dRx_o15GyGh9JhfQZELiWmEHmOFpRo_TCw/edit# since we had these discussions in cluster-api-provider-aws. @justinsb @neolit123
It would be really great to at least change up clusterctl as that is used across each provider (right now) and it would be good to be able to get stack traces from that command.
/assign @vincepri
/lifecycle active
Most helpful comment
I wrote up a document about this already https://docs.google.com/document/d/1-A96l08u0dRx_o15GyGh9JhfQZELiWmEHmOFpRo_TCw/edit# since we had these discussions in cluster-api-provider-aws. @justinsb @neolit123
It would be really great to at least change up clusterctl as that is used across each provider (right now) and it would be good to be able to get stack traces from that command.