Skip to content

Commit 204b91c

Browse files
mayastor-borstiagolobocastro
mayastor-bors
andcommitted
chore(bors): merge pull request #908
908: Cherry-pick 907 r=tiagolobocastro a=tiagolobocastro fix(csi/controller): don't return error on host mismatch Co-authored-by: Tiago Castro <[email protected]>
2 parents 0c08411 + 9db4f1e commit 204b91c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

control-plane/csi-driver/src/bin/controller/controller.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -602,18 +602,17 @@ impl rpc::csi::controller_server::Controller for CsiControllerSvc {
602602
}
603603

604604
// Do forced volume unpublish as Kubernetes already detached the volume.
605-
RestApiClient::get_client()
605+
if let Err(error) = RestApiClient::get_client()
606606
.unpublish_volume(&volume_uuid, true, Some(args.node_id.as_str()))
607607
.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+
}
617616

618617
req.info_ok();
619618
Ok(Response::new(ControllerUnpublishVolumeResponse {}))

0 commit comments

Comments
 (0)