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

update to remove github.com/pkg/errors #103114

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

learner0810
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

xref #103043

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 23, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @learner0810. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 23, 2021
@wzshiming
Copy link
Member

/area code-organization
/triage accepted
/ok-to-test

@k8s-ci-robot k8s-ci-robot added area/code-organization Issues or PRs related to kubernetes code organization ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 24, 2021
cleanUpErrs = append(cleanUpErrs, errors.Wrapf(err,
"Persistent Volume %v not deleted by dynamic provisioner", pv.Name))
cleanUpErrs = append(cleanUpErrs, fmt.Errorf(
"persistent Volume %v :%w not deleted by dynamic provisioner", pv.Name,err))
Copy link
Member

@wzshiming wzshiming Jun 24, 2021

Choose a reason for hiding this comment

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

Suggested change
"persistent Volume %v :%w not deleted by dynamic provisioner", pv.Name,err))
"persistent Volume %v : not deleted by dynamic provisioner: %w", pv.Name, err))

@@ -347,7 +346,7 @@ func loadSnapshotClass(filename string) (*unstructured.Unstructured, error) {
snapshotClass := &unstructured.Unstructured{}

if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), data, snapshotClass); err != nil {
return nil, errors.Wrap(err, filename)
return nil, fmt.Errorf("%s:%w",filename,err)
Copy link
Member

@wzshiming wzshiming Jun 24, 2021

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("%s:%w",filename,err)
return nil, fmt.Errorf("%s: %w",filename, err)

@@ -201,7 +200,7 @@ func loadDriverDefinition(filename string) (*driverDefinition, error) {
// TODO: strict checking of the file content once https://github.com/kubernetes/kubernetes/pull/71589
// or something similar is merged.
if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), data, driver); err != nil {
return nil, errors.Wrap(err, filename)
return nil, fmt.Errorf("%s:%w",filename,err)
Copy link
Member

@wzshiming wzshiming Jun 24, 2021

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("%s:%w",filename,err)
return nil, fmt.Errorf("%s: %w",filename, err)

@wzshiming
Copy link
Member

Please execute ./hack/update-gofmt.sh to format the code

@learner0810
Copy link
Contributor Author

learner0810 commented Jun 24, 2021

@wzshiming It's done thx

@learner0810
Copy link
Contributor Author

/retest

}
}

err := e2epv.DeletePersistentVolumeClaim(f.ClientSet, r.Pvc.Name, f.Namespace.Name)
if err != nil {
cleanUpErrs = append(cleanUpErrs, errors.Wrapf(err, "Failed to delete PVC %v", r.Pvc.Name))
cleanUpErrs = append(cleanUpErrs, fmt.Errorf("failed to find PVC %v: %w", r.Pvc.Name, err))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cleanUpErrs = append(cleanUpErrs, fmt.Errorf("failed to find PVC %v: %w", r.Pvc.Name, err))
cleanUpErrs = append(cleanUpErrs, fmt.Errorf("failed to delete PVC %v: %w", r.Pvc.Name, err))

Comment on lines 205 to 206
cleanUpErrs = append(cleanUpErrs, fmt.Errorf(
"persistent Volume %v: %w not deleted by dynamic provisioner", pv.Name, err))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cleanUpErrs = append(cleanUpErrs, fmt.Errorf(
"persistent Volume %v: %w not deleted by dynamic provisioner", pv.Name, err))
cleanUpErrs = append(cleanUpErrs, fmt.Errorf(
"persistent Volume %v not deleted by dynamic provisioner: %w", pv.Name, err))

@@ -173,13 +172,13 @@ func CreateItems(f *framework.Framework, ns *v1.Namespace, items ...interface{})
if err == nil {
done = true
break
} else if errors.Cause(err) != errorItemNotSupported {
} else if errors.Unwrap(err) != errorItemNotSupported {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} else if errors.Unwrap(err) != errorItemNotSupported {
} else if !errors.Is(err, errorItemNotSupported) {

@learner0810
Copy link
Contributor Author

@wzshiming sorry, I miss that ,done

@learner0810
Copy link
Contributor Author

/retest

@wzshiming
Copy link
Member

/lgtm
/assign @jsafrane

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2021
@jsafrane
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, learner0810

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 Jun 25, 2021
@k8s-ci-robot k8s-ci-robot merged commit d47448c into kubernetes:master Jun 25, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jun 25, 2021
@learner0810 learner0810 deleted the fix/remove-errors-pkg branch June 26, 2021 05:00
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/code-organization Issues or PRs related to kubernetes code organization area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants