Skip to content

Commit eb37d28

Browse files
committed
fix error when 2 pods mount same disk pvc on the same node
1 parent 05eb7bc commit eb37d28

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/azuredisk/nodeserver.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
9191
}
9292

9393
if !notMnt {
94-
msg := fmt.Sprintf("target %q is not a valid mount point", target)
95-
return nil, status.Error(codes.InvalidArgument, msg)
94+
klog.V(2).Infof("target %q is already a valid mount point(device path: %v), skip format and mount", target, devicePath)
95+
// todo: check who is mounted here. No error if its us
96+
/*
97+
1) Target Path MUST be the vol referenced by vol ID
98+
2) VolumeCapability MUST match
99+
3) Readonly MUST match
100+
*/
101+
return &csi.NodeStageVolumeResponse{}, nil
96102
}
97103
// Get fsType that the volume will be formatted with
98104
fsType := getFStype(req.GetVolumeContext())

0 commit comments

Comments
 (0)