cluster-api
cluster-api copied to clipboard
🌱 Use errors package of Go
What this PR does / why we need it:
Go has errors package to use Is() and As(). These API can check recursively if the err is one we want. So I use errors package to check recursively.
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 #
/assign
I currently don't find the time to review this PR. Just one comment, we have to be really really sure this doesn't break anything accidentally (by catching more or less errors than before)
I rebased and fixed some review points. Thanks.
The list that I should write UnitTests
- [x] handleGithubErr
- [x] (g *gitHubRepository) getVersions
- [x] (g *gitHubRepository) handleGithubErr
- [x] (r *KubeadmControlPlaneReconciler) Reconcile
Will take some time for me to get back to this. Just too much other things in my backlog.
Anyway, heads up. This PR has to be rebased once https://github.com/kubernetes-sigs/cluster-api/pull/12038 and #12037 are merged.
Some part of the changes in this PR won't be necessary anymore as I had to change the Machine controller to implement v1beta2 in 12038 (and I used errors.Is)
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
It sounds good, then if we decide to use it, we might be able to drop the direct dependence of pkg/errors completely.
Can we please stick with using pkg/errors for this PR?
We can have the discussion on how to migrate and then make this a dedicated effort, but it should not be mixed with other changes in my opinion.
(For what it's worth, I agree with Lubomir's suggestion on how to migrate)
Thx!
/lgtm /approve /test pull-cluster-api-e2e-main
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: sbueringer
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [sbueringer]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Will be fixed elsewhere
/override pull-cluster-api-e2e-main
@sbueringer: Overrode contexts on behalf of sbueringer: pull-cluster-api-e2e-main
In response to this:
Will be fixed elsewhere
/override pull-cluster-api-e2e-main
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-sigs/prow repository.