Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-csi-driver into workload-identity
  • Loading branch information
cvvz committed Dec 27, 2023
2 parents 8388a01 + 7fe3ebc commit 15c7f99
Show file tree
Hide file tree
Showing 49 changed files with 3,104 additions and 1,102 deletions.
1 change: 0 additions & 1 deletion .trivyignore

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
golang.org/x/net v0.19.0
golang.org/x/sys v0.15.0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
k8s.io/api v0.28.4
k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.28.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
10 changes: 6 additions & 4 deletions pkg/azurefile/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,11 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
return nil, status.Errorf(codes.InvalidArgument, "fsGroupChangePolicy(%s) is not supported, supported fsGroupChangePolicy list: %v", fsGroupChangePolicy, supportedFSGroupChangePolicyList)
}

if acquired := d.volumeLocks.TryAcquire(volumeID); !acquired {
lockKey := fmt.Sprintf("%s-%s", volumeID, targetPath)
if acquired := d.volumeLocks.TryAcquire(lockKey); !acquired {
return nil, status.Errorf(codes.Aborted, volumeOperationAlreadyExistsFmt, volumeID)
}
defer d.volumeLocks.Release(volumeID)
defer d.volumeLocks.Release(lockKey)

if strings.TrimSpace(storageEndpointSuffix) == "" {
if d.cloud.Environment.StorageEndpointSuffix != "" {
Expand Down Expand Up @@ -412,10 +413,11 @@ func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolume
return nil, status.Error(codes.InvalidArgument, "Staging target not provided")
}

if acquired := d.volumeLocks.TryAcquire(volumeID); !acquired {
lockKey := fmt.Sprintf("%s-%s", volumeID, stagingTargetPath)
if acquired := d.volumeLocks.TryAcquire(lockKey); !acquired {
return nil, status.Errorf(codes.Aborted, volumeOperationAlreadyExistsFmt, volumeID)
}
defer d.volumeLocks.Release(volumeID)
defer d.volumeLocks.Release(lockKey)

mc := metrics.NewMetricContext(azureFileCSIDriverName, "node_unstage_volume", d.cloud.ResourceGroup, "", d.Name)
isOperationSucceeded := false
Expand Down
8 changes: 4 additions & 4 deletions pkg/azurefile/nodeserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func TestNodeStageVolume(t *testing.T) {
{
desc: "[Error] Volume operation in progress",
setup: func() {
d.volumeLocks.TryAcquire("vol_1##")
d.volumeLocks.TryAcquire(fmt.Sprintf("%s-%s", "vol_1##", sourceTest))
},
req: csi.NodeStageVolumeRequest{VolumeId: "vol_1##", StagingTargetPath: sourceTest,
VolumeCapability: &stdVolCap,
Expand All @@ -533,7 +533,7 @@ func TestNodeStageVolume(t *testing.T) {
DefaultError: status.Error(codes.Aborted, fmt.Sprintf(volumeOperationAlreadyExistsFmt, "vol_1##")),
},
cleanup: func() {
d.volumeLocks.Release("vol_1##")
d.volumeLocks.Release(fmt.Sprintf("%s-%s", "vol_1##", sourceTest))
},
},
{
Expand Down Expand Up @@ -782,14 +782,14 @@ func TestNodeUnstageVolume(t *testing.T) {
{
desc: "[Error] Volume operation in progress",
setup: func() {
d.volumeLocks.TryAcquire("vol_1")
d.volumeLocks.TryAcquire(fmt.Sprintf("%s-%s", "vol_1", targetFile))
},
req: csi.NodeUnstageVolumeRequest{StagingTargetPath: targetFile, VolumeId: "vol_1"},
expectedErr: testutil.TestError{
DefaultError: status.Error(codes.Aborted, fmt.Sprintf(volumeOperationAlreadyExistsFmt, "vol_1")),
},
cleanup: func() {
d.volumeLocks.Release("vol_1")
d.volumeLocks.Release(fmt.Sprintf("%s-%s", "vol_1", targetFile))
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/azurefileplugin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ COPY ${binary} /azurefileplugin
RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates cifs-utils util-linux e2fsprogs mount udev xfsprogs nfs-common netbase wget

# install azcopy
ARG azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.21.2-20231106/azcopy_linux_amd64_10.21.2.tar.gz
ARG azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.22.1-20231220/azcopy_linux_amd64_10.22.1.tar.gz
RUN if [ "$ARCH" == "arm64" ] ; then \
azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.21.2-20231106/azcopy_linux_arm64_10.21.2.tar.gz; fi
azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.22.1-20231220/azcopy_linux_arm64_10.22.1.tar.gz; fi
RUN wget -O azcopy.tar.gz ${azcopyURL} && \
tar xvzf azcopy.tar.gz -C . && rm azcopy.tar.gz && \
mv ./azcopy_linux_$ARCH_*/azcopy /usr/local/bin/azcopy && \
Expand Down
38 changes: 29 additions & 9 deletions vendor/google.golang.org/protobuf/encoding/protojson/decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 34 additions & 5 deletions vendor/google.golang.org/protobuf/encoding/protojson/encode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 15c7f99

Please sign in to comment.