Skip to content

Commit 51ec091

Browse files
authored
Merge pull request #534 from andyzhangx/liveness
feat: add registrar liveness probe
2 parents ad6dcb1 + 6ae15d6 commit 51ec091

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed
34 Bytes
Binary file not shown.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ spec:
8484
preStop:
8585
exec:
8686
command: ["/bin/sh", "-c", "rm -rf /registration/{{ .Values.driver.name }}-reg.sock /csi/csi.sock"]
87+
livenessProbe:
88+
exec:
89+
command:
90+
- /csi-node-driver-registrar
91+
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
92+
- --mode=kubelet-registration-probe
93+
initialDelaySeconds: 30
94+
timeoutSeconds: 15
8795
env:
8896
- name: ADDRESS
8997
value: /csi/csi.sock

deploy/csi-blob-node.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ spec:
6262
preStop:
6363
exec:
6464
command: ["/bin/sh", "-c", "rm -rf /registration/blob.csi.azure.com-reg.sock /csi/csi.sock"]
65+
livenessProbe:
66+
exec:
67+
command:
68+
- /csi-node-driver-registrar
69+
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
70+
- --mode=kubelet-registration-probe
71+
initialDelaySeconds: 30
72+
timeoutSeconds: 15
6573
env:
6674
- name: ADDRESS
6775
value: /csi/csi.sock

pkg/blob/nodeserver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeS
388388
return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty")
389389
}
390390

391-
_, err := os.Stat(req.VolumePath)
392-
if err != nil {
391+
if _, err := os.Lstat(req.VolumePath); err != nil {
393392
if os.IsNotExist(err) {
394393
return nil, status.Errorf(codes.NotFound, "path %s does not exist", req.VolumePath)
395394
}

0 commit comments

Comments
 (0)