Skip to content

[reconfigurator] Planner: partition external DNS IP allocation separately from other service IP allocation#7056

Merged
jgallagher merged 4 commits into
mainfrom
john/partition-external-dns-ips
Nov 15, 2024
Merged

[reconfigurator] Planner: partition external DNS IP allocation separately from other service IP allocation#7056
jgallagher merged 4 commits into
mainfrom
john/partition-external-dns-ips

Conversation

@jgallagher

Copy link
Copy Markdown
Contributor

Fixes #7049; see it for context.

Removes three tests that aren't particularly useful: they're validating
that the builder rejects bogus PlanningInputs, but since those tests
were written we've updating PlanningInput itself to reject those inputs.
With the rearranging done in this PR it's not possible to construct a
PlanningInput that causes these tests to fail in the same way.
// Check the planning input: there shouldn't be any external
// networking resources in the database (the source of `input`)
// that we don't know about from the parent blueprint.
ensure_input_networking_records_appear_in_parent_blueprint(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was previously called inside BuilderExternalNetworking::new(); I moved it out here because it's the only thing that actually looked at the parent blueprint, and moving it made it much simpler to test BuilderExternalNetworking in isolation (it no longer requires constructing an entire blueprint).

}

#[test]
fn test_invalid_parent_blueprint_two_zones_with_same_external_ip() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed these tests because they were sensitive to the change in ordering of moving ensure_input_networking_records_appear_in_parent_blueprint from where it appeared in BuilderExternalNetworking::new() to just before calling BuilderExternalNetworking::new() - we get different errors instead of the specific errors these tests were checking for.

I don't think there's an easy way to fix the tests, because since these tests were written, we've introduced checks on constructing PlanningInput itself that ensures we don't have any duplicate IPs / NIC IPs / MACs. Particularly given the checks we're doing there, these seemed worthy of being dropped.

@plotnick plotnick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this! The fix and the test both look great, and the simplifications and deletions along the way are an added bonus.

use omicron_uuid_kinds::GenericUuid;
use omicron_uuid_kinds::OmicronZoneUuid;
use omicron_uuid_kinds::ZpoolUuid;
use slog_error_chain::InlineErrorChain;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TIL

Comment on lines -65 to +64
input: &'a PlanningInput,
service_ip_pool_ranges: &'a [IpRange],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decoupling this builder from the PlanningInput seems like an unambiguous win.

@jgallagher jgallagher merged commit 7cf372d into main Nov 15, 2024
@jgallagher jgallagher deleted the john/partition-external-dns-ips branch November 15, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reconfigurator] Planner can give out the same external IP to two different new zones

2 participants