Skip to content

Commit

Permalink
cleaner initial blueprint external_dns_version
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Mar 15, 2024
1 parent 51b031b commit 0b28298
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
15 changes: 11 additions & 4 deletions nexus/src/app/rack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ impl super::Nexus {
format!("{silo_dns_name}.{}", request.external_dns_zone_name);
dns_update.add_name(silo_dns_name, dns_records)?;

// We're providing an update to the initial `external_dns` group we
// defined above; also bump RSS's blueprint's `external_dns_version` to
// match this update.
let mut blueprint = request.blueprint;
blueprint.external_dns_version = blueprint.external_dns_version.next();

// Administrators of the Recovery Silo are automatically made
// administrators of the Fleet.
let mapped_fleet_roles = BTreeMap::from([(
Expand All @@ -202,9 +208,10 @@ impl super::Nexus {
name: request.recovery_silo.silo_name,
description: "built-in recovery Silo".to_string(),
},
// The recovery silo is initialized with no allocated capacity given it's
// not intended to be used to deploy workloads. Operators can add capacity
// after the fact if they want to use it for that purpose.
// The recovery silo is initialized with no allocated capacity given
// it's not intended to be used to deploy workloads. Operators can
// add capacity after the fact if they want to use it for that
// purpose.
quotas: params::SiloQuotasCreate::empty(),
discoverable: false,
identity_mode: SiloIdentityMode::LocalOnly,
Expand All @@ -221,7 +228,7 @@ impl super::Nexus {
RackInit {
rack_subnet: rack_network_config.rack_subnet.into(),
rack_id,
blueprint: request.blueprint,
blueprint,
services: request.services,
datasets,
service_ip_pool_ranges,
Expand Down
11 changes: 4 additions & 7 deletions sled-agent/src/rack_setup/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,13 +1170,10 @@ pub(crate) fn build_initial_blueprint_from_sled_configs(
zones_in_service,
parent_blueprint_id: None,
internal_dns_version,
// We don't actually configure external DNS during RSS. During handoff,
// Nexus creates an initial empty external DNS configuration, then
// creates the recovery silo, which bumps the generation.
//
// TODO-john How should we do this? Baking this knowledge of how Nexus
// sets up external DNS here seems bad.
external_dns_version: Generation::new().next(),
// We don't configure external DNS during RSS, so set it to an initial
// generation of 1. Nexus will bump this up when it updates external DNS
// (including creating the recovery silo).
external_dns_version: Generation::new(),
time_created: Utc::now(),
creator: "RSS".to_string(),
comment: "initial blueprint from rack setup".to_string(),
Expand Down

0 comments on commit 0b28298

Please sign in to comment.