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

Cleanup deprecations #1250

Merged
merged 7 commits into from
Sep 6, 2023

Conversation

surik
Copy link
Contributor

@surik surik commented Aug 22, 2023

What type of PR is this?

/kind cleanup
/kind deprecation

What this PR does / why we need it:

  • io/ioutil has been deprecated since Go 1.19.
  • rand.Seed has been deprecated since Go 1.20
  • strings.Title has been deprecated since Go 1.18
  • executor.Stream is deprecated: use StreamWithContext instead (Support cancelable SPDY executor stream kubernetes/kubernetes#103177)
  • urfave's cli.NewExitError is deprecated. This function is a duplicate of Exit and will eventually be removed.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

I addressed each issue in its own commit so should be easier to review one by one. I'm happy to squash everything if needed.

I had to exclude some checks for SA1019 as the proposed alternative doesn't look compatible with the protobuf in cri-api.

cmd/crictl/util.go:34:2: SA1019: "github.com/golang/protobuf/jsonpb" is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead. (staticcheck)
        "github.com/golang/protobuf/jsonpb"
        ^
cmd/crictl/util.go:35:2: SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead. (staticcheck)
        "github.com/golang/protobuf/proto"
        ^

Also, I'm not sure that I went right direction addressing strings.Title.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. labels Aug 22, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 22, 2023
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

code changes lgtm

/lgtm

I am not sure why static checks were disabled before, @saschagrunert ok to enable it?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 22, 2023
@SergeyKanzhelev
Copy link
Member

/remove-kind deprecation

Deprecation kind is used to deprecate features. This is a cleanup

@k8s-ci-robot k8s-ci-robot removed the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Aug 22, 2023
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @surik! Unfortunately CI is not happy about it. We could also give golangci-lint a version and config bump if you want.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 23, 2023
@surik
Copy link
Contributor Author

surik commented Aug 23, 2023

Hi @saschagrunert no need to bump golangci-lint. I had to run it locally on Linux before opening PR. I believe it should be fine now.

@surik surik changed the title Cleanup deprications Cleanup deprecations Aug 23, 2023
@saschagrunert
Copy link
Member

@surik the streaming tests seems to fail, I bet it's related to the context.

@saschagrunert
Copy link
Member

/approve
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 23, 2023
@surik
Copy link
Contributor Author

surik commented Aug 23, 2023

Honesty I do not fully understand what's wrong with the containerd tests. @saschagrunert let me know if you have any ideas.

@saschagrunert
Copy link
Member

Ugh, those tests seem to be broken all over the place 🤔

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert, SergeyKanzhelev, surik

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

@saschagrunert
Copy link
Member

Please rebase to the the latest CI changes in.

As of Golang 1.20 this is not needed anymore.
The math/rand package now automatically seeds the global random number generator
By using golang.org/x/text/cases
SA1019 - Using a deprecated function, variable, constant or field

See https://staticcheck.dev/docs/checks/#SA1019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2023
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot merged commit b871c4f into kubernetes-sigs:master Sep 6, 2023
@saschagrunert
Copy link
Member

saschagrunert commented Sep 6, 2023

@k8s-ci-robot merged without giving GitHub actions a chance to retest 👀

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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants