Make testing example more complex; improve handling for NodeUnpublishVolume/ControllerUnpublishVolume for volumes that were externally deleted
This commit is contained in:
@@ -18,6 +18,7 @@ package csi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"k8s.io/klog"
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
@@ -90,6 +91,11 @@ func (d *controllerService) DeleteVolume(ctx context.Context, request *csi.Delet
|
||||
|
||||
vol, err := d.p5x.GetVolumeByName(request.GetVolumeId())
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrVolumeNotFound) {
|
||||
klog.Infof("controller.DeleteVolume: Could not find volume %s -- assuming it has already been deleted", request.GetVolumeId())
|
||||
return &csi.DeleteVolumeResponse{}, nil
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user