fix: disable namespace delete gRPC endpoint

Do not allow this endpoint to be called - the logic is incorrect.
pull/24376/head
Dom Dwyer 2023-01-31 14:34:44 +01:00
parent d18d2c34e4
commit c70ccee4a1
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
1 changed files with 5 additions and 25 deletions

View File

@ -85,32 +85,12 @@ impl namespace_service_server::NamespaceService for NamespaceService {
async fn delete_namespace(
&self,
request: Request<DeleteNamespaceRequest>,
_request: Request<DeleteNamespaceRequest>,
) -> Result<Response<DeleteNamespaceResponse>, Status> {
if self.topic_id.is_none() || self.query_id.is_none() {
return Err(Status::invalid_argument("topic_id or query_id not set"));
}
let mut repos = self.catalog.repositories().await;
let DeleteNamespaceRequest {
name: namespace_name,
} = request.into_inner();
debug!(%namespace_name, "Deleting namespace");
repos
.namespaces()
.delete(&namespace_name)
.await
.map_err(|e| match e {
iox_catalog::interface::Error::NamespaceNotFoundByName { name: _ } => {
Status::not_found(e.to_string())
}
_ => {
warn!(error=%e, %namespace_name, "failed to delete namespace");
Status::internal(e.to_string())
}
})?;
Ok(Response::new(DeleteNamespaceResponse {}))
warn!("call to namespace delete - unimplemented");
Err(Status::unimplemented(
"namespace delete is not yet supported",
))
}
async fn update_namespace_retention(