fix: disable namespace delete gRPC endpoint
Do not allow this endpoint to be called - the logic is incorrect.pull/24376/head
parent
d18d2c34e4
commit
c70ccee4a1
|
@ -85,32 +85,12 @@ impl namespace_service_server::NamespaceService for NamespaceService {
|
||||||
|
|
||||||
async fn delete_namespace(
|
async fn delete_namespace(
|
||||||
&self,
|
&self,
|
||||||
request: Request<DeleteNamespaceRequest>,
|
_request: Request<DeleteNamespaceRequest>,
|
||||||
) -> Result<Response<DeleteNamespaceResponse>, Status> {
|
) -> Result<Response<DeleteNamespaceResponse>, Status> {
|
||||||
if self.topic_id.is_none() || self.query_id.is_none() {
|
warn!("call to namespace delete - unimplemented");
|
||||||
return Err(Status::invalid_argument("topic_id or query_id not set"));
|
Err(Status::unimplemented(
|
||||||
}
|
"namespace delete is not yet supported",
|
||||||
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 {}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn update_namespace_retention(
|
async fn update_namespace_retention(
|
||||||
|
|
Loading…
Reference in New Issue