Skip to content

Commit 21105dd

Browse files
authored
Merge branch 'master' into unit-tests
2 parents 1c1bd9d + ed414e9 commit 21105dd

12 files changed

+63
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This driver allows Kubernetes to access Azure Storage through one of following m
1515
### Container Images & Kubernetes Compatibility:
1616
|driver version |Image | supported k8s version | built-in blobfuse version |
1717
|----------------|------------------------------------------------------|-----------------------|---------------------------|
18-
|master branch |mcr.microsoft.com/k8s/csi/blob-csi:latest | 1.20+ | 1.4.4 |
18+
|master branch |mcr.microsoft.com/k8s/csi/blob-csi:latest | 1.20+ | 1.4.5 |
1919
|v1.15.0 |mcr.microsoft.com/oss/kubernetes-csi/blob-csi:v1.15.0 | 1.20+ | 1.4.4 |
2020
|v1.14.0 |mcr.microsoft.com/oss/kubernetes-csi/blob-csi:v1.14.0 | 1.20+ | 1.4.4 |
2121
|v1.13.0 |mcr.microsoft.com/oss/kubernetes-csi/blob-csi:v1.13.0 | 1.20+ | 1.4.3 |
-1 Bytes
Binary file not shown.

charts/latest/blob-csi-driver/templates/rbac-csi-blob-controller.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ metadata:
9595
rules:
9696
- apiGroups: [""]
9797
resources: ["secrets"]
98-
verbs: ["get", "list", "create"]
98+
verbs: ["get", "create"]
9999

100100
---
101101
kind: ClusterRoleBinding

charts/latest/blob-csi-driver/templates/rbac-csi-blob-node.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
rules:
1010
- apiGroups: [""]
1111
resources: ["secrets"]
12-
verbs: ["get", "list"]
12+
verbs: ["get"]
1313

1414
---
1515
kind: ClusterRoleBinding

charts/latest/blob-csi-driver/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ node:
118118
enableBlobfuseProxy: false
119119
blobfuseProxy:
120120
installBlobfuse: true
121-
blobfuseVersion: 1.4.4
121+
blobfuseVersion: 1.4.5
122122
setMaxOpenFileNum: true
123123
maxOpenFileNum: "9000000"
124124
disableUpdateDB: true

deploy/csi-blob-node.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- name: INSTALL_BLOBFUSE_PROXY
5252
value: "true"
5353
- name: BLOBFUSE_VERSION
54-
value: 1.4.4
54+
value: 1.4.5
5555
- name: SET_MAX_OPEN_FILE_NUM
5656
value: "true"
5757
- name: MAX_FILE_NUM

deploy/rbac-csi-blob-controller.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ metadata:
9191
rules:
9292
- apiGroups: [""]
9393
resources: ["secrets"]
94-
verbs: ["get", "list", "create"]
94+
verbs: ["get", "create"]
9595

9696
---
9797
kind: ClusterRoleBinding

deploy/rbac-csi-blob-node.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
rules:
1414
- apiGroups: [""]
1515
resources: ["secrets"]
16-
verbs: ["get", "list"]
16+
verbs: ["get"]
1717

1818
---
1919
kind: ClusterRoleBinding

docs/driver-parameters.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ k8s-azure-created-by: azure
5151
pvc-92a4d7f2-f23b-4904-bad4-2cbfcff6e388
5252
```
5353

54-
- VolumeId is identifier for the volume generated after volume is created by plugin successfully, the format of VolumeId is: `rg#accountName#containerName#uuid#secretNamespace#subsID`, and if current account is in the same subs as the driver, `subsID` would be empty.
54+
- VolumeID(`volumeHandle`) is the identifier for the volume handled by the driver, format of VolumeID: `rg#accountName#containerName#uuid#secretNamespace#subscriptionID`
55+
> `uuid`, `secretNamespace`, `subscriptionID` are optional
5556
5657
### Static Provisioning(bring your own storage container)
5758
> [blobfuse example](../deploy/example/pv-blobfuse-csi.yaml)

pkg/blobfuse-proxy/init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ then
2929
cp /blobfuse-proxy/packages-microsoft-prod.deb /host/etc/
3030
$HOST_CMD dpkg -i /etc/packages-microsoft-prod.deb && \
3131
$HOST_CMD apt update && \
32-
$HOST_CMD apt-get install -y blobfuse="${BLOBFUSE_VERSION}" && \
32+
$HOST_CMD apt-get install -y fuse blobfuse="${BLOBFUSE_VERSION}" && \
3333
$HOST_CMD rm -f /etc/packages-microsoft-prod.deb
3434
fi
3535

pkg/csi-common/utils_test.go

+12-13
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
"bytes"
2121
"context"
2222
"flag"
23+
"io"
24+
"os"
2325
"testing"
2426

2527
"github.com/container-storage-interface/spec/lib/go/csi"
@@ -83,21 +85,9 @@ func TestParseEndpoint(t *testing.T) {
8385
}
8486

8587
func TestLogGRPC(t *testing.T) {
86-
// SET UP
87-
klog.InitFlags(nil)
88-
if e := flag.Set("logtostderr", "false"); e != nil {
89-
t.Error(e)
90-
}
91-
if e := flag.Set("alsologtostderr", "false"); e != nil {
92-
t.Error(e)
93-
}
94-
if e := flag.Set("v", "100"); e != nil {
95-
t.Error(e)
96-
}
97-
flag.Parse()
98-
9988
buf := new(bytes.Buffer)
10089
klog.SetOutput(buf)
90+
defer klog.SetOutput(io.Discard)
10191

10292
handler := func(ctx context.Context, req interface{}) (interface{}, error) { return nil, nil }
10393
info := grpc.UnaryServerInfo{
@@ -232,3 +222,12 @@ func TestGetLogLevel(t *testing.T) {
232222
}
233223
}
234224
}
225+
226+
func TestMain(m *testing.M) {
227+
klog.InitFlags(nil)
228+
_ = flag.Set("logtostderr", "false")
229+
_ = flag.Set("alsologtostderr", "false")
230+
_ = flag.Set("v", "100")
231+
klog.SetOutput(io.Discard)
232+
os.Exit(m.Run())
233+
}

pkg/util/util_test.go

+41
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,46 @@ func TestConvertTagsToMap(t *testing.T) {
203203
output, err := ConvertTagsToMap(test.tags)
204204
assert.Equal(t, test.expectedOut, output, test.desc)
205205
assert.Equal(t, test.expectedErr, err, test.desc)
206+
=======
207+
type StringMap map[string]string
208+
tests := []struct {
209+
tags string
210+
expected map[string]string
211+
err bool
212+
}{
213+
{
214+
tags: "",
215+
expected: StringMap{},
216+
err: false,
217+
},
218+
{
219+
tags: "key1=value1, key2=value2,key3= value3",
220+
expected: StringMap{"key1": "value1", "key2": "value2", "key3": "value3"},
221+
err: false,
222+
},
223+
{
224+
tags: " key = value ",
225+
expected: StringMap{"key": "value"},
226+
err: false,
227+
},
228+
{
229+
tags: "keyvalue",
230+
expected: nil,
231+
err: true,
232+
},
233+
{
234+
tags: " = value,=",
235+
expected: nil,
236+
err: true,
237+
},
238+
}
239+
for _, test := range tests {
240+
result, err := ConvertTagsToMap(test.tags)
241+
if test.err {
242+
assert.NotNil(t, err)
243+
} else {
244+
assert.Nil(t, err)
245+
}
246+
assert.Equal(t, result, test.expected)
206247
}
207248
}

0 commit comments

Comments
 (0)