-
Notifications
You must be signed in to change notification settings - Fork 373
Remove dependency to k8s.io/kubernetes #618
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
Remove dependency to k8s.io/kubernetes #618
Conversation
|
Hi @ialidzhikov. Thanks for your PR. I'm waiting for a kubernetes-csi 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. DetailsInstructions 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. |
|
/assign @msau42 |
|
/ok-to-test |
|
|
||
| replace k8s.io/component-helpers => k8s.io/component-helpers v0.21.0 | ||
|
|
||
| replace k8s.io/mount-utils => k8s.io/mount-utils v0.21.0 |
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.
Please don't remove these replace statements.
go get -u ./... breaks without them.
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.
You can prune them by running release-tools/go-get-kubernetes.sh 1.21.0.
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.
Well, to be honest I am not super convinced that we should keep the replace statements. I now executed release-tools/go-get-kubernetes.sh 1.21.0 and the end result was pretty much the same - it added the same replace statements.
I see replace statements for pkgs such as k8s.io/sample-apiserver, k8s.io/sample-cli-plugin, k8s.io/sample-controller which are obviously pkgs that the external-provisioner does not vendor or import in any way. I don't see reason why we should have such replace statements.
To my understanding the main goal of #603 is actually to get rid of these replace statements.
So I don't think release-tools/go-get-kubernetes.sh is needed/useful anymore as external-provisioner no longer vendors k8s.io/kubernetes. If you want I can put replace statements only for the k8s.io pkgs that external-provisioner vendors and imports.
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.
Well, to be honest I am not super convinced that we should keep the replace statements.
Then try running go get -u ./... in your branch without them...
I now executed release-tools/go-get-kubernetes.sh 1.21.0 and the end result was pretty much the same
Ah, sorry. I thought we had updated release-tools/go-get-kubernetes.sh already, but it is still behind the one in csi-release-tools. Try the script from https://github.com/kubernetes-csi/csi-release-tools/blob/master/go-get-kubernetes.sh - that one will prune unused replace statements.
To my understanding the main goal of #603 is actually to get rid of these replace statements.
No, the main goal is to replace code from k/k with code that is meant to be used by out-of-tree components.
If you want I can put replace statements only for the k8s.io pkgs that external-provisioner vendors and imports.
That's what the updated go-get-kubernetes.sh does.
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.
Hmm, it actually works better than expected. But elsewhere I've seen it update client-go to a 1.x version that was older than the intended 0.21.0, so I stand by my assessment that these replace statements are a useful safeguard against using inconsistent and potentially wrong versions of the Kubernetes packages.
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.
Looks like this particular issue with client-go was fixed in https://github.com/kubernetes/client-go/releases/tag/v1.5.2
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, sorry. I thought we had updated release-tools/go-get-kubernetes.sh already, but it is still behind the one in csi-release-tools. Try the script from https://github.com/kubernetes-csi/csi-release-tools/blob/master/go-get-kubernetes.sh - that one will prune unused replace statements.
Thanks for the hint! The run with the latest release-tools/go-get-kubernetes.sh script was much better. I updated the PR now with https://github.com/kubernetes-csi/external-provisioner/compare/a44abfbfb181d32d7c47d048cdf320c1efee0420..6f779f3c7eb8082c534aada2a95d796eaac8ce23.
PS. However the output from release-tools/go-get-kubernetes.sh 1.21.0 was still not the one that I expected. It updated some of the dependencies to v0.21.1-rc.0.
$ release-tools/go-get-kubernetes.sh 1.21.0
# [...]
go get: upgraded k8s.io/apimachinery v0.21.0 => v0.21.1-rc.0
SUCCESS
From the output I see that the script fetches the kubernetes-1.21.0 branch instead of the corresponding tag that I want. However this is just a guess and the small issue with the script is a separate topic for enhancement.
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.
Given that the client-go issue seems to be resolved, I prefer to remove the replace statements to keep this easier to comprehend and update.
This is fine for now
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.
However the output from release-tools/go-get-kubernetes.sh 1.21.0 was still not the one that I expected. It updated some of the dependencies to v0.21.1-rc.0.
Go does that when both tags are identical. It then reports the more recent one.
Signed-off-by: ialidzhikov <[email protected]>
a44abfb to
6f779f3
Compare
|
@ialidzhikov: 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. DetailsInstructions 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ialidzhikov, msau42 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind cleanup
Fixes #603
Does this PR introduce a user-facing change?: