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

Fixes for Deprecation of io/ioutil (in Go 1.16) #100367

Closed
dims opened this issue Mar 18, 2021 · 22 comments · Fixed by #106021, #106020, #106019, #106018 or #106015
Closed

Fixes for Deprecation of io/ioutil (in Go 1.16) #100367

dims opened this issue Mar 18, 2021 · 22 comments · Fixed by #106021, #106020, #106019, #106018 or #106015
Assignees
Labels
area/code-organization Issues or PRs related to kubernetes code organization kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.

Comments

@dims
Copy link
Member

dims commented Mar 18, 2021

Please see https://golang.org/doc/go1.16#ioutil

We have a lot of references to ioutil which we need to migrate to newer package(s) mentioned in the url above:
https://cs.k8s.io/?q=io%2Fioutil&i=nope&files=.*%5C.go&excludeFiles=&repos=kubernetes/kubernetes

We also need some verify scripts to ensure we don't add back this package

/area code-organization

@dims dims added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 18, 2021
@k8s-ci-robot k8s-ci-robot added the area/code-organization Issues or PRs related to kubernetes code organization label Mar 18, 2021
@k8s-ci-robot
Copy link
Contributor

@dims: There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

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 the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Mar 18, 2021
@k8s-ci-robot
Copy link
Contributor

@dims: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 18, 2021
@dims dims added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. and removed 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. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Mar 18, 2021
@dims
Copy link
Member Author

dims commented Mar 18, 2021

/sig architecture

(seems like this cuts across everything!)

@k8s-ci-robot k8s-ci-robot added the sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. label Mar 18, 2021
@liggitt
Copy link
Member

liggitt commented Mar 18, 2021

The package is deprecated but is not planned for removal. Switching is fine, but this is not urgent

@harshanarayana
Copy link
Contributor

@dims mind if I take a look at this ?

/assign @harshanarayana

@dims
Copy link
Member Author

dims commented Mar 18, 2021

Ack @liggitt !

@harshanarayana
Copy link
Contributor

harshanarayana commented Mar 18, 2021

@dims For the script to verify the and ensure we don't add this back again, can I modify the existing importverifier toolchain to add a new disallowedImports field with similar behavior support as that of allowedImports ?

2021/03/18 19:43:40 Inspecting imports under ./cmd/importverifier...
2021/03/18 19:43:40 - validating imports for 1 packages in the tree
2021/03/18 19:43:40 -- found forbidden imports for k8s.io/kubernetes/cmd/importverifier:
2021/03/18 19:43:40 --- io/ioutil
2021/03/18 19:43:40 - FAIL
- baseImportPath: "./cmd/importverifier"
  disallowedImports:
  - io/ioutil

@liggitt
Copy link
Member

liggitt commented Mar 18, 2021

ioutil is extremely widely used, and is not actually a problem to continue using... make sure the importverifier doesn't complain if we depend on it transitively via a vendored dependency

@harshanarayana
Copy link
Contributor

@liggitt Sure. I will keep that in mind. I will enable this as a soft warning behavior if that is all right with everyone so that we can warn them but not fail the check right-away. Once we decide to enforce it, we can switch the config to fail the checks.

@liggitt
Copy link
Member

liggitt commented Mar 18, 2021

@dims, I'm skeptical that this is worth the effort to warn/sweep existing code

@dims
Copy link
Member Author

dims commented Mar 18, 2021

@liggitt ack on the warn/verify we can deal with that later (i'll check on possibilities). let's focus this issue to just the bulk replace

@harshanarayana
Copy link
Contributor

Ack. Thanks @dims @liggitt

@BenTheElder
Copy link
Member

Most of the methods in ioutil have relatively simple implementations that seem stable, doubly so if it's deprecated 🙃
If go isn't planning to remove this package any time soon I'm also not sure it's worth the cost of forcing library consumers to use go1.16+?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 17, 2021
@palnabarun
Copy link
Member

/remove-lifecycle stale
/priority important-longterm
(based on #100367 (comment). Please feel to correct, if otherwise)

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 30, 2021
@mythi
Copy link
Contributor

mythi commented Nov 18, 2022

@dims looks like people are still submitting PRs on this topic and they are not getting reviewed. From Go perspective there's no update since the 1.16 announcement (AFAIK). Should we revisit this goal?

@BenTheElder BenTheElder reopened this Nov 18, 2022
@k8s-ci-robot
Copy link
Contributor

@dims: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@liggitt
Copy link
Member

liggitt commented Jan 26, 2023

From Go perspective there's no update since the 1.16 announcement (AFAIK). Should we revisit this goal?

Go compatibility means the deprecated functions will not be removed. I'm not in favor of this goal... I think it's churn with little purpose.

@dims
Copy link
Member Author

dims commented Jun 12, 2023

/close

@k8s-ci-robot
Copy link
Contributor

@dims: Closing this issue.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-organization Issues or PRs related to kubernetes code organization kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.
Projects
None yet
9 participants