kubernetes-csi / external-snapshotter

Sidecar container that watches Kubernetes Snapshot CRD objects and triggers CreateSnapshot/DeleteSnapshot against a CSI endpoint.
Apache License 2.0
502 stars 375 forks source link

Update CSI Spec #1174

Closed yati1998 closed 3 weeks ago

yati1998 commented 1 month ago

this commit updates csi spec version to include latest changes for volume group snapshot

Update CSI spec to a commit after v1.10.0 where VolumeGroupSnapshot moved to GA
k8s-ci-robot commented 1 month ago

Hi @yati1998. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
xing-yang commented 1 month ago

/ok-to-test

xing-yang commented 1 month ago

We need to update again after CSI Spec is officially released.

xing-yang commented 1 month ago

Please add a release note.

yati1998 commented 4 weeks ago

We need to update again after CSI Spec is officially released.

sure, will add a TODO for that. lets get it for now.

xing-yang commented 3 weeks ago

You probably need to take a look at this PR: https://github.com/kubernetes-csi/external-provisioner/pull/1262

xing-yang commented 3 weeks ago

Make this change, then it should work:

$ git diff main_test.go
diff --git a/cmd/csi-snapshotter/main_test.go b/cmd/csi-snapshotter/main_test.go
index c3ecf9d5..05c93e9e 100644
--- a/cmd/csi-snapshotter/main_test.go
+++ b/cmd/csi-snapshotter/main_test.go
@@ -23,6 +23,7 @@ import (

        "github.com/container-storage-interface/spec/lib/go/csi"
        "github.com/golang/mock/gomock"
+       "github.com/kubernetes-csi/csi-test/v5/utils"
        "github.com/kubernetes-csi/csi-lib-utils/connection"
        "github.com/kubernetes-csi/csi-lib-utils/metrics"
        "github.com/kubernetes-csi/csi-test/v5/driver"
@@ -125,7 +126,7 @@ func Test_supportsControllerCreateSnapshot(t *testing.T) {
                }

                // Setup expectation
-               controllerServer.EXPECT().ControllerGetCapabilities(gomock.Any(), in).Return(out, injectedErr).Times(1)
+               controllerServer.EXPECT().ControllerGetCapabilities(gomock.Any(), utils.Protobuf(in)).Return(out, injectedErr).Times(1)
xing-yang commented 3 weeks ago

Also here:

$ git diff snapshotter_test.go
diff --git a/pkg/snapshotter/snapshotter_test.go b/pkg/snapshotter/snapshotter_test.go
index 148848ff..8d6c79ef 100644
--- a/pkg/snapshotter/snapshotter_test.go
+++ b/pkg/snapshotter/snapshotter_test.go
@@ -25,6 +25,7 @@ import (

        "github.com/container-storage-interface/spec/lib/go/csi"
        "github.com/golang/mock/gomock"
+       "github.com/kubernetes-csi/csi-test/v5/utils"
        "github.com/kubernetes-csi/csi-lib-utils/connection"
        "github.com/kubernetes-csi/csi-lib-utils/metrics"
        "github.com/kubernetes-csi/csi-test/v5/driver"
@@ -210,7 +211,7 @@ func TestCreateSnapshot(t *testing.T) {
                // Setup expectation
                if in != nil {
                        identityServer.EXPECT().GetPluginInfo(gomock.Any(), gomock.Any()).Return(pluginInfoOutput, nil).Times(1)
-                       controllerServer.EXPECT().CreateSnapshot(gomock.Any(), in).Return(out, injectedErr).Times(1)
+                       controllerServer.EXPECT().CreateSnapshot(gomock.Any(), utils.Protobuf(in)).Return(out, injectedErr).Times(1)
                }

                s := NewSnapshotter(csiConn)
@@ -318,7 +319,7 @@ func TestDeleteSnapshot(t *testing.T) {

                // Setup expectation
                if in != nil {
-                       controllerServer.EXPECT().DeleteSnapshot(gomock.Any(), in).Return(out, injectedErr).Times(1)
+                       controllerServer.EXPECT().DeleteSnapshot(gomock.Any(), utils.Protobuf(in)).Return(out, injectedErr).Times(1)
                }

                s := NewSnapshotter(csiConn)
@@ -463,7 +464,7 @@ func TestGetSnapshotStatus(t *testing.T) {
                                Capabilities: controllerCapabilities,
                        }, nil).Times(1)
                        if test.listSnapshotsSupported {
-                               controllerServer.EXPECT().ListSnapshots(gomock.Any(), in).Return(out, injectedErr).Times(1)
+                               controllerServer.EXPECT().ListSnapshots(gomock.Any(), utils.Protobuf(in)).Return(out, injectedErr).Times(1)
                        }
                }
xing-yang commented 3 weeks ago

/retest

xing-yang commented 3 weeks ago

/lgtm /approve

Trivy failure is unrelated to this change.

k8s-ci-robot commented 3 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xing-yang, yati1998

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: - ~~[OWNERS](https://github.com/kubernetes-csi/external-snapshotter/blob/master/OWNERS)~~ [xing-yang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment