Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gracfully delete secondary dns record #828

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions svc/pkg/cluster/worker/src/workers/server_dns_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,23 @@ async fn inner(

// Delete secondary record
if let Some(record_id) = secondary_dns_record_id {
client
let res = client
.request(&cf::dns::DeleteDnsRecord {
zone_identifier: zone_id,
identifier: &record_id,
})
.await?;
.await;

tracing::info!(%record_id, "deleted secondary dns record");
if let Err(cf_framework::response::ApiFailure::Error(
http::status::StatusCode::NOT_FOUND,
_,
)) = res
{
tracing::warn!(%zone_id, %record_id, "secondary dns record not found");
} else {
res?;
tracing::info!(%record_id, "deleted secondary dns record");
}
} else {
tracing::warn!("server has no secondary dns record");
}
Expand Down
Loading