Skip to content

Commit

Permalink
chore: skip force unstage if app node is not found
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Dec 12, 2024
1 parent cd397c7 commit 499e665
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions control-plane/csi-driver/src/bin/controller/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,12 @@ impl rpc::csi::controller_server::Controller for CsiControllerSvc {
}?;

// Issue a cleanup rpc to csi node to ensure the subsystem doesn't have any path present before publishing
let app_node = RestApiClient::get_client().get_app_node(&args.node_id).await?;
force_unstage(app_node, volume_id.to_string()).await?;
match RestApiClient::get_client().get_app_node(&args.node_id).await {
Ok(app_node) => force_unstage(app_node, volume_id.to_string()).await?,
Err(ApiClientError::ResourceNotExists(..)) => warn!("App node: {}, not found, skipping force unstage volume", args.node_id),
Err(error) => return Err(error.into())
}


// Volume is not published.
let v = RestApiClient::get_client()
Expand Down

0 comments on commit 499e665

Please sign in to comment.