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 dependency go modules for k8s v1.26.0 #123

Merged

Conversation

sunnylovestiramisu
Copy link
Contributor

Ran kubernetes-csi/csi-release-tools go-get-kubernetes.sh -p 1.26.0

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 19, 2022
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 19, 2022
@sunnylovestiramisu
Copy link
Contributor Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 19, 2022
@sunnylovestiramisu
Copy link
Contributor Author

sunnylovestiramisu commented Dec 19, 2022

make test failed with TestConnectMetrics

The diffs are:

connection_test.go:404: Running testcase Regular connection test
connection_test.go:432: Expected client metrics not found -- 

-csi_sidecar_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 0

+csi_sidecar_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 0.000649487

=======================

-csi_plugin_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 0

+csi_plugin_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 1.075e-06

=======================

-csi_sidecar_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo",migrated="true"} 0

+csi_sidecar_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo",migrated="true"} 0.000252969

Seems like the type conversion in between changed from int to some doubles?

@sunnylovestiramisu
Copy link
Contributor Author

Also noticed that the unit test is saying we should ignore the csi_sidecar_operations_seconds_sum metrics?

https://github.com/kubernetes-csi/csi-lib-utils/blob/master/connection/connection_test.go#L429

@sunnylovestiramisu
Copy link
Contributor Author

/assign @Jiawei0227

Do you have any context on this?

@sunnylovestiramisu
Copy link
Contributor Author

sunnylovestiramisu commented Dec 20, 2022

1.25.0 release is not broken, the breaking change started at 1.26.0: #124

@sunnylovestiramisu
Copy link
Contributor Author

I am not sure what the magic is but i copied the dependencies from the 1.25.0 pr and then ran go mod tidy/vendor etc. and now this pr is passing as well.

@sunnylovestiramisu
Copy link
Contributor Author

/assign @xing-yang

go.mod Outdated
k8s.io/api v0.22.0
k8s.io/client-go v0.22.0
github.com/stretchr/testify v1.8.0
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change this to v0.4.0? There's a CVE in earlier version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure let me do that

Copy link
Contributor

Choose a reason for hiding this comment

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

You are going to update this to v0.4.0, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one has been constantly downgraded again. Let me update.

k8s.io/component-base v0.22.0
k8s.io/klog/v2 v2.9.0
k8s.io/klog/v2 v2.80.1
Copy link
Contributor

Choose a reason for hiding this comment

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

k8s.io/component-base v0.22.0?

Can this be updated to 0.26.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update to 0.26.0 break the unit tests as we see above.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Can you add a comment about this in the PR description?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should update the component-base and fix the tests. I'm not sure if there will be any side effects if the sidecars and the library use two different versions of component-base: https://github.com/kubernetes-csi/external-provisioner/blob/master/go.mod#L24

go.mod Outdated
@@ -1,23 +1,62 @@
module github.com/kubernetes-csi/csi-lib-utils

go 1.16
go 1.19

require (
github.com/container-storage-interface/spec v1.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this to 1.7.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why 1.17? k8s 1.26.0 is at 1.19

Copy link
Contributor

@xing-yang xing-yang Dec 20, 2022

Choose a reason for hiding this comment

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

github.com/container-storage-interface/spec v1.5.0 -> v1.7.0 which is the latest CSI spec release. This is not K8s release. Also not go version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this comment is about github.com/container-storage-interface/spec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I need to fix the previous 1.25.0 first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the go version for github.com/container-storage-interface is 1.18? https://github.com/container-storage-interface/spec/blob/release-1.7/go.mod

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be fine. It's not possible for all dependency libs to use the exact same go version.

Copy link
Contributor

@xing-yang xing-yang Dec 21, 2022

Choose a reason for hiding this comment

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

I see this is still github.com/container-storage-interface/spec v1.5.0. Is there any issue updating to github.com/container-storage-interface/spec v1.7.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry I somehow was thinking you want me to update the go version to 1.17.0, changing it now. And i am still trying to fix the component base.

@sunnylovestiramisu sunnylovestiramisu force-pushed the module-update-master branch 2 times, most recently from 2515761 to 4d068b7 Compare December 21, 2022 00:25
go.mod Outdated
@@ -1,34 +1,33 @@
module github.com/kubernetes-csi/csi-lib-utils

go 1.18
go 1.17
Copy link
Contributor

@xing-yang xing-yang Dec 21, 2022

Choose a reason for hiding this comment

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

This should still be updated to go 1.19.

go.mod Outdated
@@ -1,34 +1,33 @@
module github.com/kubernetes-csi/csi-lib-utils

go 1.18
go 1.19
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep it at 1.18. 1.19 would indicate that the code in this repo needs 1.19, which isn't the case.

@sunnylovestiramisu
Copy link
Contributor Author

The error has changed from this line after upgraded to component-base 0.26.0

Diff:
--- metric output does not match expectation; want
+++ got:
@@ -16,3 +16,3 @@
 csi_plugin_operations_seconds_bucket{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo",le="+Inf"} 1
-csi_plugin_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 0
+csi_plugin_operations_seconds_sum{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 4.81e-07
 csi_plugin_operations_seconds_count{driver_name="fake.csi.driver.io",grpc_status_code="Unimplemented",method_name="/csi.v1.Identity/GetPluginInfo"} 1
connection_test.go:458: 

This results in the want split does not have the expected string to compare on this line

The want string is:

Diff:
--- metric output does not match expectation; want
+++ 

We need to change the split rule to something without the ":":

wantArr := strings.Split(err.Error(), "want")

This also ends up in certain situations the want string contains one line extra, so we need to remove that line so we can scan later:

want = strings.ReplaceAll(want, "+++ got:", "")

@msau42
Copy link
Collaborator

msau42 commented Dec 22, 2022

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msau42, sunnylovestiramisu

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 Dec 22, 2022
@k8s-ci-robot k8s-ci-robot merged commit 975107d into kubernetes-csi:master Dec 22, 2022
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
No open projects
Status: PRs Approved
Development

Successfully merging this pull request may close these issues.

None yet

6 participants