Skip to content

Commit 0702896

Browse files
committed
Merge branch 'master' of https://github.com/kubernetes-sigs/blob-csi-driver into fix103
2 parents 7676d9f + a5f1c9a commit 0702896

File tree

74 files changed

+2081
-869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2081
-869
lines changed

deploy/example/nfs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## NFSv3 support
2-
[NFS 3.0 protocol support on Azure Blob storage](https://docs.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support) is best suited for large scale read-heavy sequential access workload where data will be ingested once and minimally modified further. E.g. large scale analytic data, backup and archive, NFS apps for media rendering, and genomic sequencing etc. It offers lowest total cost of ownership.
2+
[NFS 3.0 protocol support on Azure Blob storage](https://docs.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support) is best suited for large scale read-heavy sequential access workload where data will be ingested once and minimally modified further. e.g. large scale analytic data, backup and archive, NFS apps for media rendering, and genomic sequencing etc. It offers lowest total cost of ownership.
3+
- [Compare access to Azure Files, Blob Storage, and Azure NetApp Files with NFS](https://docs.microsoft.com/en-us/azure/storage/common/nfs-comparison)
34

45
#### Supported OS: Linux
56
- dynamic account creation support is available from `v1.2.0`

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ require (
1818
github.com/onsi/gomega v1.19.0
1919
github.com/pborman/uuid v1.2.0
2020
github.com/pelletier/go-toml v1.9.4
21-
github.com/stretchr/testify v1.7.1
21+
github.com/stretchr/testify v1.8.0
2222
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
2323
google.golang.org/grpc v1.42.0
2424
google.golang.org/protobuf v1.27.1
25-
k8s.io/api v0.24.1
26-
k8s.io/apimachinery v0.24.1
27-
k8s.io/client-go v0.24.1
28-
k8s.io/component-base v0.24.1
29-
k8s.io/klog/v2 v2.60.1
25+
k8s.io/api v0.24.3
26+
k8s.io/apimachinery v0.24.3
27+
k8s.io/client-go v0.24.3
28+
k8s.io/component-base v0.24.3
29+
k8s.io/klog/v2 v2.70.1
3030
k8s.io/kubernetes v1.23.3
3131
k8s.io/mount-utils v0.23.3
3232
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
@@ -37,7 +37,7 @@ require (
3737
require (
3838
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.1
3939
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.0.0
40-
k8s.io/apiserver v0.24.0
40+
k8s.io/apiserver v0.24.3
4141
)
4242

4343
require (
@@ -60,7 +60,7 @@ require (
6060
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
6161
github.com/felixge/httpsnoop v1.0.1 // indirect
6262
github.com/fsnotify/fsnotify v1.5.4 // indirect
63-
github.com/go-logr/logr v1.2.0 // indirect
63+
github.com/go-logr/logr v1.2.3 // indirect
6464
github.com/gogo/protobuf v1.3.2 // indirect
6565
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
6666
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
@@ -89,7 +89,7 @@ require (
8989
github.com/prometheus/client_model v0.2.0 // indirect
9090
github.com/prometheus/common v0.32.1 // indirect
9191
github.com/prometheus/procfs v0.7.3 // indirect
92-
github.com/spf13/cobra v1.4.0 // indirect
92+
github.com/spf13/cobra v1.5.0 // indirect
9393
github.com/spf13/pflag v1.0.5 // indirect
9494
go.opentelemetry.io/contrib v0.20.0 // indirect
9595
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
@@ -113,11 +113,11 @@ require (
113113
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
114114
gopkg.in/yaml.v2 v2.4.0 // indirect
115115
gopkg.in/yaml.v3 v3.0.1 // indirect
116-
k8s.io/cloud-provider v0.24.0 // indirect
117-
k8s.io/component-helpers v0.24.0 // indirect
116+
k8s.io/cloud-provider v0.24.2 // indirect
117+
k8s.io/component-helpers v0.24.3 // indirect
118118
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
119119
k8s.io/kubectl v0.0.0 // indirect
120-
k8s.io/kubelet v0.24.1 // indirect
120+
k8s.io/kubelet v0.24.2 // indirect
121121
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect
122122
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
123123
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
@@ -156,5 +156,5 @@ replace (
156156
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.3
157157
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.23.3
158158
k8s.io/sample-controller => k8s.io/sample-controller v0.23.3
159-
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220531043058-58a44c080b6c
159+
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220721071156-49e3ba00fb91
160160
)

go.sum

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
178178
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
179179
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
180180
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
181-
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
181+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
182182
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
183183
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
184184
github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg=
@@ -243,8 +243,9 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
243243
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
244244
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
245245
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
246-
github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE=
247246
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
247+
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
248+
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
248249
github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro=
249250
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
250251
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -509,7 +510,7 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
509510
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
510511
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
511512
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
512-
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
513+
github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
513514
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
514515
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
515516
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
@@ -594,8 +595,8 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
594595
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
595596
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
596597
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
597-
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
598-
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
598+
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
599+
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
599600
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
600601
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
601602
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
@@ -610,14 +611,16 @@ github.com/storageos/go-api v2.2.0+incompatible/go.mod h1:ZrLn+e0ZuF3Y65PNF6dIwb
610611
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
611612
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
612613
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
614+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
613615
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
614616
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
615617
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
616618
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
617619
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
618620
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
619-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
620621
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
622+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
623+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
621624
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
622625
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
623626
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@@ -1185,8 +1188,8 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
11851188
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
11861189
k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
11871190
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
1188-
k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc=
1189-
k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
1191+
k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ=
1192+
k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
11901193
k8s.io/kube-aggregator v0.23.3/go.mod h1:pt5QJ3QaIdhZzNlUvN5wndbM0LNT4BvhszGkzy2QdFo=
11911194
k8s.io/kube-controller-manager v0.23.3/go.mod h1:e8m5dhjei67DlLZA/QTvenxiGyonG9UhgHtU1LMslJE=
11921195
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c=
@@ -1222,8 +1225,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
12221225
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27/go.mod h1:tq2nT0Kx7W+/f2JVE+zxYtUhdjuELJkVpNz+x/QN5R4=
12231226
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 h1:dUk62HQ3ZFhD48Qr8MIXCiKA8wInBQCtuE4QGfFW7yA=
12241227
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw=
1225-
sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220531043058-58a44c080b6c h1:SgCS9lbrwUEL3bozBSNxKH2AXQUEfDnUXDt5l1hpqIc=
1226-
sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220531043058-58a44c080b6c/go.mod h1:oW9XxeH23niDy6jsv93rjOjAHCZUoroeYeFkqx8vmsM=
1228+
sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220721071156-49e3ba00fb91 h1:i2AjmSKmRY4KvU/PFo1UcmDHr+KtP58e+O1tg/2yIak=
1229+
sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220721071156-49e3ba00fb91/go.mod h1:VtfgpOsu4dCqrg77K3LuiiVCAfH7M5w/J5Bv7XOBRf0=
12271230
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
12281231
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y=
12291232
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY=

pkg/blob/controllerserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
224224

225225
tags, err := util.ConvertTagsToMap(customTags)
226226
if err != nil {
227-
return nil, err
227+
return nil, status.Errorf(codes.InvalidArgument, err.Error())
228228
}
229229

230230
accountOptions := &azure.AccountOptions{
@@ -257,7 +257,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
257257
// search in cache first
258258
cache, err := d.accountSearchCache.Get(lockKey, azcache.CacheReadTypeDefault)
259259
if err != nil {
260-
return nil, err
260+
return nil, status.Errorf(codes.Internal, err.Error())
261261
}
262262
if cache != nil {
263263
accountName = cache.(string)
@@ -366,7 +366,7 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
366366
}
367367

368368
if err := d.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil {
369-
return nil, fmt.Errorf("invalid delete volume req: %v", req)
369+
return nil, status.Errorf(codes.Internal, "invalid delete volume req: %v", req)
370370
}
371371

372372
if acquired := d.volumeLocks.TryAcquire(volumeID); !acquired {
@@ -521,7 +521,7 @@ func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.Controller
521521
}
522522

523523
if err := d.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_EXPAND_VOLUME); err != nil {
524-
return nil, fmt.Errorf("invalid expand volume req: %v", req)
524+
return nil, status.Errorf(codes.Internal, "invalid expand volume req: %v", req)
525525
}
526526

527527
volSizeBytes := int64(req.GetCapacityRange().GetRequiredBytes())

pkg/blob/controllerserver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func TestCreateVolume(t *testing.T) {
258258
controllerServiceCapability,
259259
}
260260
_, err := d.CreateVolume(context.Background(), req)
261-
expectedErr := fmt.Errorf("Tags 'unit-test' are invalid, the format should like: 'key1=value1,key2=value2'")
261+
expectedErr := status.Errorf(codes.InvalidArgument, "Tags 'unit-test' are invalid, the format should like: 'key1=value1,key2=value2'")
262262
if !reflect.DeepEqual(err, expectedErr) {
263263
t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
264264
}
@@ -389,7 +389,7 @@ func TestDeleteVolume(t *testing.T) {
389389
VolumeId: "unit-test",
390390
}
391391
_, err := d.DeleteVolume(context.Background(), req)
392-
expectedErr := fmt.Errorf("invalid delete volume req: volume_id:\"unit-test\" ")
392+
expectedErr := status.Errorf(codes.Internal, "invalid delete volume req: volume_id:\"unit-test\" ")
393393
if !reflect.DeepEqual(err, expectedErr) {
394394
t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
395395
}
@@ -724,7 +724,7 @@ func TestControllerExpandVolume(t *testing.T) {
724724
CapacityRange: &csi.CapacityRange{},
725725
}
726726
_, err := d.ControllerExpandVolume(context.Background(), req)
727-
expectedErr := fmt.Errorf("invalid expand volume req: volume_id:\"unit-test\" capacity_range:<> ")
727+
expectedErr := status.Errorf(codes.Internal, "invalid expand volume req: volume_id:\"unit-test\" capacity_range:<> ")
728728
if !reflect.DeepEqual(err, expectedErr) {
729729
t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
730730
}

pkg/blob/nodeserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
124124
klog.Warningf("NodePublishVolume: mock mount on volumeID(%s), this is only for TESTING!!!", volumeID)
125125
if err := volumehelper.MakeDir(target, os.FileMode(mountPermissions)); err != nil {
126126
klog.Errorf("MakeDir failed on target: %s (%v)", target, err)
127-
return nil, err
127+
return nil, status.Errorf(codes.Internal, err.Error())
128128
}
129129
return &csi.NodePublishVolumeResponse{}, nil
130130
}
@@ -271,7 +271,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
271271

272272
_, accountName, _, containerName, authEnv, err := d.GetAuthEnv(ctx, volumeID, protocol, attrib, secrets)
273273
if err != nil {
274-
return nil, err
274+
return nil, status.Errorf(codes.Internal, err.Error())
275275
}
276276

277277
// replace pv/pvc name namespace metadata in subDir
@@ -341,7 +341,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
341341
klog.Warningf("NodeStageVolume: mock mount on volumeID(%s), this is only for TESTING!!!", volumeID)
342342
if err := volumehelper.MakeDir(targetPath, os.FileMode(mountPermissions)); err != nil {
343343
klog.Errorf("MakeDir failed on target: %s (%v)", targetPath, err)
344-
return nil, err
344+
return nil, status.Errorf(codes.Internal, err.Error())
345345
}
346346
return &csi.NodeStageVolumeResponse{}, nil
347347
}
@@ -354,7 +354,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
354354
}
355355

356356
if err != nil {
357-
err = fmt.Errorf("Mount failed with error: %w, output: %v", err, output)
357+
err = status.Errorf(codes.Internal, "Mount failed with error: %v, output: %v", err, output)
358358
klog.Errorf("%v", err)
359359
notMnt, mntErr := d.mounter.IsLikelyNotMountPoint(targetPath)
360360
if mntErr != nil {

vendor/github.com/go-logr/logr/README.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)