Skip to content

Commit 6e03b58

Browse files
committed
fix: trim new line for azure storage account name
1 parent 78d6e72 commit 6e03b58

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: StatefulSet
4+
metadata:
5+
name: statefulset-blob
6+
labels:
7+
app: nginx
8+
spec:
9+
serviceName: statefulset-blob
10+
replicas: 1
11+
template:
12+
metadata:
13+
labels:
14+
app: nginx
15+
spec:
16+
securityContext: # optional just to make sure user is non-root
17+
runAsUser: 10001
18+
runAsGroup: 10001
19+
fsGroup: 10001
20+
nodeSelector:
21+
"kubernetes.io/os": linux
22+
containers:
23+
- name: statefulset-blob
24+
image: andyzhangx/ubuntu1604:nonroot
25+
command:
26+
- "/bin/sh"
27+
- "-c"
28+
- while true; do echo $(date) >> /mnt/blob/outfile; sleep 1; done
29+
volumeMounts:
30+
- name: persistent-storage
31+
mountPath: /mnt/blob
32+
updateStrategy:
33+
type: RollingUpdate
34+
selector:
35+
matchLabels:
36+
app: nginx
37+
volumeClaimTemplates:
38+
- metadata:
39+
name: persistent-storage
40+
annotations:
41+
volume.beta.kubernetes.io/storage-class: blob
42+
spec:
43+
accessModes: ["ReadWriteMany"]
44+
resources:
45+
requests:
46+
storage: 100Gi

pkg/blob/blob.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ func getStorageAccount(secrets map[string]string) (string, string, error) {
503503
return accountName, accountKey, fmt.Errorf("could not find %s or %s field in secrets(%v)", accountKeyField, defaultSecretAccountKey, secrets)
504504
}
505505

506+
accountName = strings.TrimSpace(accountName)
506507
klog.V(4).Infof("got storage account(%s) from secret", accountName)
507508
return accountName, accountKey, nil
508509
}

0 commit comments

Comments
 (0)