-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
pkg/errors is no longer maintained and archived #6688
Comments
There are two options which I think can be done
there might be more but these come to my mind there are few issues regarding this in other repos kubernetes/release#2549 |
I have to think about it a bit more but the approach in kubernetes/release#2549 sounds like a reasonable option and obviously consistent with upstream Kubernetes. |
@sbueringer What are your thoughts on this? Is this something we can start working on, but wait with prs until 1.2 is released? |
I think we need more discussion before we should do anything. I would especially like to hear the opinions of other maintainers on this as it's a pretty fundamental change |
I would align to whatever k/k does |
the Wrap(f) gives formatting consistency and avoids leakage of k/k is not taking action for kubeadm for the time being, although there was a ticket somewhere. |
/triage accepted Let's keep this around to monitor the situation, but I will aling to k/k and not take action for the time being |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
/lifecycle frozen |
(doing some cleanup on old issues without updates) |
@fabriziopandini: Closing this issue. In response to this:
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. |
/reopen Given that I see continued comments from maintainers if we should get rid of pkg/errors |
@sbueringer: Reopened this issue. In response to this:
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. |
The problem with just directly replacing it through Go SDK '%w' is that we lose information. Most visible in logs. Example: err1 := fmt.Errorf("err1")
err2 := fmt.Errorf("err2: %w", err1)
log.Error(err2, "Go SDK error wrapping")
err1 = pkgerrors.New("err1")
err2 = pkgerrors.Wrapf(err1, "err2")
log.Error(err2, "pkgerrors wrapping") Resulting logs
Note: Full error stack traces are only implemented with JSON format not with text. This is because JSON logging in component-base is implemented with zap and zap automatically adds errVerbose if err implements fmt.Formatter (xref: https://github.com/uber-go/zap/blob/master/zapcore/error.go#L70-L77) As can be seen, pkg/errors preserves the stack trace of where the error occurs which can vastly simplify debugging. I think we have the following options:
If we have consensus replacing it could potentially be pretty straightforward using Intellij's "Structural Search and Replace feature" (https://www.jetbrains.com/help/idea/structural-search-and-replace.html#to_search_structurally). |
if it's no longer maintainer, but it has no critical bugs, then there is no problem with using it?
maybe we can try to add it in component-base? or kubernetes/kubeadm/errors?
and lose formatting, since sometimes |
Good point. I think there is no reason why we would have to migrate away now. I mostly reopened this because it was brought up a few times on PRs and this issue seems like a better place for discussion. |
I don't think that as a CAPI community w should/we have enough resources to maintain an error package |
in k/k there was a tracking issue to drop all usage, but for cmd/kubeadm we requested an exception. |
/kind cleanup |
/priority important-longterm |
To be honest, I'm not sure what we want to do or if we want to do something, but just found out that pkg/errors is archived.
See: pkg/errors#245
/kind bug
/area dependency
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]
The text was updated successfully, but these errors were encountered: