-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Delete ioutil as it is Deprecated since Go 1.16 #3157
Conversation
Hi @yanggangtony. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
Welcome @yanggangtony! |
The kind project still supports Go versions back to 1.14. The replacements did not exist in the older releases. It should eventually be raised to only support newer go versions, but until that decision is made, this needs to stay with using |
Right, importantly KIND is embeddable as a library for testing purposes, so we take great care in changing the requirements for library users (including adding more dependencies, bumping go version required, etc.) It might be reasonable to start requiring go1.16, but we should actually do so by changing the go.mod go statement if we're going to. Go 1.16 came out February 2021 about a year after Go 1.14. While go only officially supports 1.19 and 1.20 currently, until very recently Kubernetes itself did not bump go versions on release branches so we could not drop version support as quickly as Go does upstream. Does this improve anything immediately? Are there any bug fixes we're missing because we haven't moved? |
@stmcginnis @BenTheElder Yes , you are right . |
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.
I see at least one case that isn't clearly equivalent, otherwise I think this looks good and we can do this in the next kind release.
Let's update go.mod to 1.16
pkg/fs/fs.go
Outdated
if err != nil { | ||
return err | ||
} | ||
for _, entry := range entries { | ||
entrySrc := filepath.Join(src, entry.Name()) | ||
entryDst := filepath.Join(dst, entry.Name()) | ||
if err := copy(entrySrc, entryDst, entry); err != nil { | ||
fileInfo, _ := entry.Info() |
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.
we shouldn't discard this 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.
entries, err := os.ReadDir(src)
In the above code , If the err is nil , Maybe deduction the entry.Info()
will return normal code without err .
But you are right , we should consider the error side..
I will update it later...
Signed-off-by: yanggang <gang.yang@daocloud.io>
Signed-off-by: yanggang <gang.yang@daocloud.io>
Another commit to bump go.mod to 1.16.. |
/ok-to-test |
/retest |
Hmm that's a concerning timeout https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kind/3157/pull-kind-e2e-kubernetes-1-27/1649154486473592832 I don't think it's related to this PR but ... that's also not something I'd been seeing. It shouldn't take that long to build. |
/lgtm |
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.
/lgtm
/approve
thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, yanggangtony 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 |
@yanggangtony: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
Delete ioutil as it is Deprecated since Go 1.16
ioutil info.
We can use os and io package for the same logic in the future.