Skip to content

Commit 4dd974e

Browse files
authored
Merge pull request #250 from pohly/controller-unpublish-volume-not-found
mock: avoid "not found" error in ControllerUnpublishVolume
2 parents f1bd856 + 2df9ddc commit 4dd974e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mock/service/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ func (s *service) ControllerUnpublishVolume(
244244

245245
i, v := s.findVolNoLock("id", req.VolumeId)
246246
if i < 0 {
247-
return nil, status.Error(codes.NotFound, req.VolumeId)
247+
// Not an error: a non-existent volume is not published.
248+
// See also https://github.com/kubernetes-csi/external-attacher/pull/165
249+
return &csi.ControllerUnpublishVolumeResponse{}, nil
248250
}
249251

250252
// devPathKey is the key in the volume's attributes that is set to a

0 commit comments

Comments
 (0)