Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a5e0264
should be the needful.. think the dns server needs soa testing too
iximeow Apr 22, 2025
084553c
ok why does the test fail though
iximeow Apr 22, 2025
5c8cded
looking basically reasonable now i think
iximeow Apr 22, 2025
2a5b875
at least one omdb test needs updating..
iximeow Apr 22, 2025
a6150a4
puzzling that the nameserver IPs are like that though
iximeow Apr 22, 2025
182f98e
actually answer NS and SOA queries, one more todo
iximeow Apr 23, 2025
086d996
actually unwind local ipcc overrides
iximeow Apr 23, 2025
af76a85
deny DNS updates that define SOA records
iximeow Apr 24, 2025
f77c4aa
no magic @ string
iximeow Apr 24, 2025
9ea1427
oops, goofy test misses
iximeow Apr 24, 2025
19907ac
openapi happy, clippy happy, maybe its ok now
iximeow Apr 25, 2025
fa47ab1
bump progenitor, this works but obviously incorrect approach
iximeow Apr 25, 2025
aa3ecae
test should clean up when it passes, rustfmt
iximeow Apr 28, 2025
69cd5d0
shuffle dns types and versions around to more suitable places
iximeow Apr 28, 2025
0f17ae6
clean up BOTH new tests actually
iximeow Apr 28, 2025
bfb25a5
dont just duplicate v1 and v2 DNS API impls
iximeow Apr 30, 2025
33ee507
make the into impls a little more reasonable
iximeow May 1, 2025
9b8c813
add a test exercising DNS server/client version combinations
iximeow May 1, 2025
d399431
move the lossy v2->v1 dns types conversions to not *Into
iximeow May 1, 2025
276356e
why was that there
iximeow May 2, 2025
069d2cd
update Crucible and bump Progenitor to go with it
iximeow May 2, 2025
8a9747d
Update nexus/db-model/src/dns.rs
iximeow May 2, 2025
69f1506
review comments from Dave, ty
iximeow May 5, 2025
b6db528
"dns_resolver" -> dns_nameserver
iximeow May 6, 2025
0807629
rustfmt
iximeow May 6, 2025
d3d59a0
rework SOA to not exist in the database, instead synthesize on demand
iximeow May 9, 2025
427c1d6
wire up SOA answers and NXDomain correctly now that SOA is synthesize…
iximeow May 13, 2025
1b1af79
V1 DNS HTTP clients cannot GET if V2 records are present
iximeow May 13, 2025
e45b8f0
move DNS serial selection to Nexus (and delete old SOA arms)
iximeow May 15, 2025
12605e3
internal DNS has NS records and ns<N>.oxide.internal records now!
iximeow May 20, 2025
a65f160
anyway, blueprints should yield records at the apex too
iximeow May 21, 2025
dbe1448
shuffle reconfigurator test files around
iximeow May 22, 2025
bf0ef2b
existing tests don't look totally right (the interim state doesn't lo…
iximeow May 22, 2025
0452cb6
external DNS reconfiguration fixed up, update other tests listing DNS…
iximeow May 22, 2025
9a82034
set up internal DNS reconfigurator-cli test, looks reasonable too
iximeow May 22, 2025
ed9fdd8
rustfmt
iximeow May 22, 2025
bfba9f1
answers refer to DNS serial numbers, not config generations
iximeow May 22, 2025
21e2160
prior_silo_name -> prior_record_name
iximeow May 22, 2025
9981995
don't need to assert when constructing external DNS configuration
iximeow May 22, 2025
3ba1960
Merge remote-tracking branch 'github/main' into ixi/dns-ns-and-soa
iximeow May 22, 2025
4088b73
adjusted that name wrong
iximeow May 22, 2025
3821a1f
do not create empty apex records if there are no name servers
iximeow May 23, 2025
b29eda8
correct other test issues now that it actually changes DNS config
iximeow May 24, 2025
3af6f18
rustfmt, clippy
iximeow May 24, 2025
4bafb09
ah, changed APIs so regenerate openapi
iximeow May 24, 2025
e646534
digest thoughts about who sees what synthesized data into docs
iximeow May 27, 2025
ff63ea1
DnsConfigZone::records -> DnsConfigZone::names
iximeow May 27, 2025
a99660d
sort external IPs before making NS records
iximeow May 27, 2025
db7b7d8
merge conflict kept around an old copy of dns expunge
iximeow May 27, 2025
727343c
cleanup and self-review
iximeow May 27, 2025
954e577
describe some of the happenings in the external dns test
iximeow May 27, 2025
d1cf240
and fix up the internal DNS reconfigurator-cli test after bad merge
iximeow May 27, 2025
f4251e5
and update the OpenAPI spec because i changed records->names
iximeow May 27, 2025
8c6b357
and we don't need empty stderr file here
iximeow May 27, 2025
9b1b846
Update dns-server/src/dns_server.rs
iximeow May 30, 2025
c12b276
Revert "DnsConfigZone::records -> DnsConfigZone::names".
iximeow May 30, 2025
2c1841b
review feedback
iximeow May 30, 2025
0214828
clippy
iximeow May 30, 2025
31691bb
use VERSION_ constants instead of semver strings in API versions
iximeow May 30, 2025
a330948
accidentally stashed the change to delete this comment...
iximeow May 31, 2025
6ab6003
unwind more unnecessary diff
iximeow May 31, 2025
f33dea6
adjust external DNS config test to be a bit clearer
iximeow May 31, 2025
5a4c249
"serial" was misleading and kinda pointless
iximeow May 31, 2025
7de2cc1
names -> records revert comes with rolling back openapi changes
iximeow May 31, 2025
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/dns-service-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub type DnsError = crate::Error<crate::types::Error>;
pub const ERROR_CODE_UPDATE_IN_PROGRESS: &'static str = "UpdateInProgress";
pub const ERROR_CODE_BAD_UPDATE_GENERATION: &'static str =
"BadUpdateGeneration";
pub const ERROR_CODE_INCOMPATIBLE_RECORD: &'static str = "IncompatibleRecord";

/// Returns whether an error from this client should be retried
pub fn is_retryable(error: &DnsError) -> bool {
Expand Down
4 changes: 4 additions & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ impl Generation {
);
Generation(next_gen)
}

pub const fn as_u64(self) -> u64 {
self.0
}
}

impl<'de> Deserialize<'de> for Generation {
Expand Down
3 changes: 2 additions & 1 deletion dev-tools/omdb/src/bin/omdb/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6645,7 +6645,7 @@ fn print_name(
if records.len() == 1 {
match &records[0] {
DnsRecord::Srv(_) => (),
DnsRecord::Aaaa(_) | DnsRecord::A(_) => {
DnsRecord::Aaaa(_) | DnsRecord::A(_) | DnsRecord::Ns(_) => {
println!(
"{} {:50} {}",
prefix,
Expand All @@ -6670,6 +6670,7 @@ fn format_record(record: &DnsRecord) -> impl Display {
DnsRecord::Srv(Srv { port, target, .. }) => {
format!("SRV port {:5} {}", port, target)
}
DnsRecord::Ns(ns) => format!("NS {}", ns),
}
}

Expand Down
6 changes: 5 additions & 1 deletion dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ DNS zone: oxide-dev.test (External)
requested version: 2 (created at <REDACTED_TIMESTAMP>)
version created by Nexus: ..........<REDACTED_UUID>...........
version created because: create silo: "test-suite-silo"
changes: names added: 1, names removed: 0
changes: names added: 3, names removed: 0

+ @ NS ns1.oxide-dev.test
+ ns1 AAAA ::1
+ test-suite-silo.sys A 127.0.0.1
---------------------------------------------
stderr:
Expand All @@ -42,6 +44,8 @@ termination: Exited(0)
stdout:
External zone: oxide-dev.test
NAME RECORDS
@ NS ns1.oxide-dev.test
ns1 AAAA ::1
test-suite-silo.sys A 127.0.0.1
---------------------------------------------
stderr:
Expand Down
9 changes: 9 additions & 0 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ enum BlueprintEditCommands {
},
/// expunge a zone
ExpungeZone { zone_id: OmicronZoneUuid },
/// mark an expunged zone ready for cleanup
MarkForCleanup { zone_id: OmicronZoneUuid },
/// configure an SP update
SetSpUpdate {
/// serial number to update
Expand Down Expand Up @@ -1123,6 +1125,13 @@ fn cmd_blueprint_edit(
.context("failed to expunge zone")?;
format!("expunged zone {zone_id} from sled {sled_id}")
}
BlueprintEditCommands::MarkForCleanup { zone_id } => {
let sled_id = sled_with_zone(&builder, &zone_id)?;
builder
.sled_mark_expunged_zone_ready_for_cleanup(sled_id, zone_id)
.context("failed to mark zone ready for cleanup")?;
format!("marked zone {zone_id} ready for cleanup")
}
BlueprintEditCommands::SetSpUpdate {
serial,
artifact_hash,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This is a legacy test; new tests shouldn't need to set a seed

load-example --seed test_expunge_newly_added_external_dns

blueprint-show 3f00b694-1b16-4aaa-8f78-e6b3a527b434
blueprint-edit 3f00b694-1b16-4aaa-8f78-e6b3a527b434 expunge-zone 9995de32-dd52-4eb1-b0eb-141eb84bc739

# Diff DNS to see that the expunged zone is no longer has DNS records.
blueprint-diff 3f00b694-1b16-4aaa-8f78-e6b3a527b434 366b0b68-d80e-4bc1-abd3-dc69837847e0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, between the diff size and having conflicting changes on main, i had a hard time keeping the output a more legible "file moved and now has some additional lines". instead, git shows the diff as a fully new file even though it's mostly the prior content.

blueprint-diff includes the DNS output though, which is of course what i actually care about here. if this is a bear to review (and i'm pretty empathetic to it being a lot) i'm open to moving the DNS checking over to a new test and leaving this unchanged, or moving the internal DNS testing to live in this test as well.


blueprint-show 366b0b68-d80e-4bc1-abd3-dc69837847e0
# blueprint-plan will place a new external DNS zone, diff DNS to see the new zone has `ns<N>` and NS records.
blueprint-plan 366b0b68-d80e-4bc1-abd3-dc69837847e0
blueprint-diff 366b0b68-d80e-4bc1-abd3-dc69837847e0 9c998c1d-1a7b-440a-ae0c-40f781dea6e2

blueprint-show 9c998c1d-1a7b-440a-ae0c-40f781dea6e2
# expunging the new zone should work, then diff again to see the new zone also have its DNS records removed.
blueprint-edit 9c998c1d-1a7b-440a-ae0c-40f781dea6e2 expunge-zone d786ef4a-5acb-4f5d-a732-a00addf986b5
blueprint-diff 9c998c1d-1a7b-440a-ae0c-40f781dea6e2 2ac8c740-444d-42ff-8d66-9812a7e51288
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load-example

blueprint-show dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
# Expunge an internal DNS zone
blueprint-edit dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 expunge-zone 5a526763-1d2b-42a5-b2ef-42f58aa8cbfa
# Diff against the new blueprint; the zone has been expunged so its records should be removed.
blueprint-diff dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1

# Mark the internal DNS zone ready for cleanup.
# This approximates sled-agent performing an inventory collection and seeing the DNS zone has gone away.
# This zone's records were removed in the expunge before, so there are no further DNS changes.
blueprint-edit 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 mark-for-cleanup 5a526763-1d2b-42a5-b2ef-42f58aa8cbfa
blueprint-diff 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 58d5e830-0884-47d8-a7cd-b2b3751adeb4

# Planning a new blueprint will now replace the expunged zone, with new records for its replacement.
blueprint-plan 58d5e830-0884-47d8-a7cd-b2b3751adeb4
blueprint-diff 58d5e830-0884-47d8-a7cd-b2b3751adeb4 af934083-59b5-4bf6-8966-6fb5292c29e1

This file was deleted.

Loading
Loading