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
PowerVS: Remove deprecated errors package #7544
PowerVS: Remove deprecated errors package #7544
Conversation
c4e124d
to
94d83a8
Compare
/retest |
157a8b4
to
a22d0b7
Compare
/assign @r4f4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're changing the case-ness of some output messages, don't forget to update the unit tests that check for those messages.
@@ -2,7 +2,6 @@ package powervs | |||
|
|||
import ( | |||
"context" | |||
"errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the built-in errors
lib, you don't need to remove this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I leave it in, then I get:
pkg/asset/installconfig/powervs/validation.go:5:2: "errors" imported and not used
And I would think that if I had used it in that file, then the compiler would complain if I didn't include it...
@@ -2,7 +2,7 @@ package validation | |||
|
|||
import ( | |||
"crypto/rand" | |||
"errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one, I put back and it compiled fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But lint complains:
pkg/types/powervs/validation/platform_test.go:5:2: "errors" imported but not used (typecheck)
"errors"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because you changed the line that used it below: errors.New(...)
. I was saying that those errors.New
calls don't necessarily need to be replaced because they are using the built-in errors
lib, not the archived github.com/pkg/errors
package one.
Good catch! Updated... |
4133d7c
to
a88ea28
Compare
@hamzy: The following tests failed, say
Full PR test history. Your PR dashboard. 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 understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: r4f4 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 |
if vpcName == "" || vpcSubnet == "" { | ||
return "", false, nil | ||
} | ||
|
||
vpc, err := m.client.GetVPCByName(ctx, vpcName) | ||
if err != nil { | ||
return "", false, errors.Wrap(err, "failed to get VPC") | ||
return colonPercentW, false, fmt.Errorf("failed to get VPC: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage here seems to have changed. This may need to be a separate commit for tracking purposes, as this doesn't look like it is only a change to remove the errors package as indicated in the PR. Same for all of the usages in this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage here changed because of a new lint error. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hamzy I don't see the PR history complaining about that being an empty string. I see the linter complaining about it since it was used multiple times. My concern was that you are returning something other than the empty string. Do you have an example output of the first complaint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/asset/installconfig/powervs/metadata.go:161:10: string `: %w` has 4 occurrences, make it a constant (goconst)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think I see what you are asking about... let me investigate...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@barbacbd I pushed a new version...
a88ea28
to
bbc6b96
Compare
/lgtm |
/hold |
Wrote a program [1] to remove all occurances of the go-lang errors package. 1) https://github.com/hamzy/powervs-hack/tree/main/remove-errors
bbc6b96
to
df5bb10
Compare
/lgtm |
/hold cancel |
/retest-required |
/retest-required |
/retest-required |
/hold Revision df5bb10 was retested 3 times: holding |
/retest-required |
@hamzy: The following test failed, say
Full PR test history. Your PR dashboard. 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 understand the commands that are listed here. |
/retest-required |
Wrote a program [1] to remove all occurances of the go-lang errors package.