Skip to content

Commit

Permalink
Merge pull request #2658 from andyzhangx/upgrade-csi-spec
Browse files Browse the repository at this point in the history
chore: update CSI spec to v1.10.0
  • Loading branch information
andyzhangx authored Nov 22, 2024
2 parents 61f1430 + d23d644 commit 4e0e202
Show file tree
Hide file tree
Showing 12 changed files with 8,545 additions and 4,541 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/mocks v0.4.2
github.com/container-storage-interface/spec v1.9.0
github.com/container-storage-interface/spec v1.10.0
github.com/fsnotify/fsnotify v1.8.0
github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/container-storage-interface/spec v1.9.0 h1:zKtX4STsq31Knz3gciCYCi1SXtO2HJDecIjDVboYavY=
github.com/container-storage-interface/spec v1.9.0/go.mod h1:ZfDu+3ZRyeVqxZM0Ds19MVLkN2d1XJ5MAfi1L3VjlT0=
github.com/container-storage-interface/spec v1.10.0 h1:YkzWPV39x+ZMTa6Ax2czJLLwpryrQ+dPesB34mrRMXA=
github.com/container-storage-interface/spec v1.10.0/go.mod h1:DtUvaQszPml1YJfIK7c00mlv6/g4wNMLanLgiUbKFRI=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
Expand Down
6 changes: 6 additions & 0 deletions pkg/azuredisk/azuredisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ type hostUtil interface {
// DriverCore contains fields common to both the V1 and V2 driver, and implements all interfaces of CSI drivers
type DriverCore struct {
csicommon.CSIDriver
// Embed UnimplementedXXXServer to ensure the driver returns Unimplemented for any
// new RPC methods that might be introduced in future versions of the spec.
csi.UnimplementedControllerServer
csi.UnimplementedIdentityServer
csi.UnimplementedNodeServer

perfOptimizationEnabled bool
cloudConfigSecretName string
cloudConfigSecretNamespace string
Expand Down
7 changes: 4 additions & 3 deletions pkg/azuredisk/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"reflect"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -847,9 +848,9 @@ func TestControllerPublishVolume(t *testing.T) {
VolumeId: "vol_1",
VolumeCapability: volumeCapWrong,
}
expectedErr := status.Error(codes.InvalidArgument, "invalid access mode: [mount:<> access_mode:<mode:10 > ]")
expectedErr := status.Error(codes.InvalidArgument, "invalid access mode: [mount:{} access_mode:{mode:10}]")
_, err := d.ControllerPublishVolume(context.Background(), req)
if !reflect.DeepEqual(err, expectedErr) {
if !reflect.DeepEqual(err, expectedErr) && !strings.Contains(err.Error(), "invalid access mode") {
t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
}
},
Expand Down Expand Up @@ -1180,7 +1181,7 @@ func TestControllerExpandVolume(t *testing.T) {
d, _ := NewFakeDriver(cntl)
var csc []*csi.ControllerServiceCapability
d.setControllerCapabilities(csc)
expectedErr := status.Error(codes.InvalidArgument, "invalid expand volume request: volume_id:\"vol_1\" ")
expectedErr := status.Error(codes.InvalidArgument, "invalid expand volume request: volume_id:\"vol_1\"")
_, err := d.ControllerExpandVolume(ctx, req)
if !reflect.DeepEqual(err, expectedErr) {
t.Errorf("Unexpected error: %v", err)
Expand Down
2 changes: 0 additions & 2 deletions pkg/azuredisk/identityserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func TestProbe(t *testing.T) {
resp, err := d.Probe(context.Background(), &req)
assert.NoError(t, err)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
assert.Equal(t, resp.Ready.Value, true)

}
Expand All @@ -83,5 +82,4 @@ func TestGetPluginCapabilities(t *testing.T) {
resp, err := d.GetPluginCapabilities(context.Background(), &req)
assert.NoError(t, err)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
}
Loading

0 comments on commit 4e0e202

Please sign in to comment.