Skip to content

Commit

Permalink
Merge pull request #813 from kubernetes-sigs/liveness-linux
Browse files Browse the repository at this point in the history
feat: add registrar liveness probe on Linux
  • Loading branch information
andyzhangx committed Oct 9, 2021
2 parents c2520be + ac99ec9 commit eea17ea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Binary file modified charts/latest/azurefile-csi-driver-v1.7.0.tgz
Binary file not shown.
Expand Up @@ -72,6 +72,14 @@ spec:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/{{ .Values.driver.name }}-reg.sock /csi/csi.sock"]
livenessProbe:
exec:
command:
- /csi-node-driver-registrar
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --mode=kubelet-registration-probe
initialDelaySeconds: 30
timeoutSeconds: 15
env:
- name: ADDRESS
value: /csi/csi.sock
Expand Down
8 changes: 8 additions & 0 deletions deploy/csi-azurefile-node.yaml
Expand Up @@ -62,6 +62,14 @@ spec:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/file.csi.azure.com-reg.sock /csi/csi.sock"]
livenessProbe:
exec:
command:
- /csi-node-driver-registrar
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --mode=kubelet-registration-probe
initialDelaySeconds: 30
timeoutSeconds: 15
env:
- name: ADDRESS
value: /csi/csi.sock
Expand Down
3 changes: 1 addition & 2 deletions pkg/azurefile/nodeserver.go
Expand Up @@ -353,8 +353,7 @@ func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeS
return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty")
}

_, err := os.Stat(req.VolumePath)
if err != nil {
if _, err := os.Lstat(req.VolumePath); err != nil {
if os.IsNotExist(err) {
return nil, status.Errorf(codes.NotFound, "path %s does not exist", req.VolumePath)
}
Expand Down

0 comments on commit eea17ea

Please sign in to comment.