File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
control-plane/csi-driver/src/bin/controller Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -655,18 +655,17 @@ impl rpc::csi::controller_server::Controller for CsiControllerSvc {
655655 }
656656
657657 // Do forced volume unpublish as Kubernetes already detached the volume.
658- RestApiClient :: get_client ( )
658+ if let Err ( error ) = RestApiClient :: get_client ( )
659659 . unpublish_volume ( & volume_uuid, true , Some ( args. node_id . as_str ( ) ) )
660660 . await
661- . map_err ( |e| match e {
662- ApiClientError :: NotAcceptable ( _) => {
663- Status :: ok ( "Ignoring failure on unpublish due to mismatched host" )
664- }
665- _ => Status :: not_found ( format ! (
666- "Failed to unpublish volume {}, error = {:?}" ,
667- & args. volume_id, e
668- ) ) ,
669- } ) ?;
661+ {
662+ if !matches ! ( error, ApiClientError :: NotAcceptable ( _) ) {
663+ return Err ( Status :: not_found ( format ! (
664+ "Failed to unpublish volume {}, error = {error:?}" ,
665+ & args. volume_id
666+ ) ) ) ;
667+ }
668+ }
670669
671670 req. info_ok ( ) ;
672671 Ok ( Response :: new ( ControllerUnpublishVolumeResponse { } ) )
You can’t perform that action at this time.
0 commit comments