File tree 1 file changed +9
-10
lines changed
control-plane/csi-driver/src/bin/controller
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -602,18 +602,17 @@ impl rpc::csi::controller_server::Controller for CsiControllerSvc {
602
602
}
603
603
604
604
// Do forced volume unpublish as Kubernetes already detached the volume.
605
- RestApiClient :: get_client ( )
605
+ if let Err ( error ) = RestApiClient :: get_client ( )
606
606
. unpublish_volume ( & volume_uuid, true , Some ( args. node_id . as_str ( ) ) )
607
607
. await
608
- . map_err ( |e| match e {
609
- ApiClientError :: NotAcceptable ( _) => {
610
- Status :: ok ( "Ignoring failure on unpublish due to mismatched host" )
611
- }
612
- _ => Status :: not_found ( format ! (
613
- "Failed to unpublish volume {}, error = {:?}" ,
614
- & args. volume_id, e
615
- ) ) ,
616
- } ) ?;
608
+ {
609
+ if !matches ! ( error, ApiClientError :: NotAcceptable ( _) ) {
610
+ return Err ( Status :: not_found ( format ! (
611
+ "Failed to unpublish volume {}, error = {error:?}" ,
612
+ & args. volume_id
613
+ ) ) ) ;
614
+ }
615
+ }
617
616
618
617
req. info_ok ( ) ;
619
618
Ok ( Response :: new ( ControllerUnpublishVolumeResponse { } ) )
You can’t perform that action at this time.
0 commit comments