Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstanton committed Dec 6, 2023
1 parent a7e3aba commit d090960
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
25 changes: 20 additions & 5 deletions tembo-operator/src/app_service/ingress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,19 @@ pub async fn reconcile_ingress(
// Check if there are any IngressRoute objects with the label component=appService and delete them
let ingress_routes = ingress_api.list(&lp).await?;
for ingress_route in ingress_routes.items {
match ingress_api.delete(&ingress_route.metadata.name.unwrap(), &Default::default()).await {
match ingress_api
.delete(&ingress_route.metadata.name.unwrap(), &Default::default())
.await
{
Ok(_) => {
debug!("ns: {}, successfully deleted IngressRoute: {}", ns, coredb_name);
return Ok(());
}
Err(e) => {
error!("ns: {}, Failed to delete IngressRoute: {}, error: {}", ns, coredb_name, e);
error!(
"ns: {}, Failed to delete IngressRoute: {}, error: {}",
ns, coredb_name, e
);
return Err(e);
}
}
Expand Down Expand Up @@ -442,13 +448,22 @@ pub async fn reconcile_ingress_tcp(
// Check if there are any IngressRouteTCP objects with the label component=appService and delete them
let ingress_tcp_routes = ingress_api.list(&lp).await?;
for ingress_tcp_route in ingress_tcp_routes.items {
match ingress_api.delete(&ingress_tcp_route.metadata.name.unwrap(), &Default::default()).await {
match ingress_api
.delete(&ingress_tcp_route.metadata.name.unwrap(), &Default::default())
.await
{
Ok(_) => {
debug!("ns: {}, successfully deleted IngressRouteTCP: {}", ns, coredb_name);
debug!(
"ns: {}, successfully deleted IngressRouteTCP: {}",
ns, coredb_name
);
return Ok(());
}
Err(e) => {
error!("ns: {}, Failed to delete IngressRouteTCP: {}, error: {}", ns, coredb_name, e);
error!(
"ns: {}, Failed to delete IngressRouteTCP: {}, error: {}",
ns, coredb_name, e
);
return Err(e);
}
}
Expand Down
5 changes: 3 additions & 2 deletions tembo-operator/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3399,8 +3399,9 @@ CREATE EVENT TRIGGER pgrst_watch
assert_eq!(ingresses.len(), 0);

// Assert IngressRouteTCP is gone
let ingresses_tcp: Vec<IngressRouteTCP> =
list_resources(client.clone(), cdb_name, &namespace, 0).await.unwrap();
let ingresses_tcp: Vec<IngressRouteTCP> = list_resources(client.clone(), cdb_name, &namespace, 0)
.await
.unwrap();
assert_eq!(ingresses_tcp.len(), 0);

// CLEANUP TEST
Expand Down

0 comments on commit d090960

Please sign in to comment.