Skip to content

Commit 65c8aed

Browse files
authored
[reconfigurator-planning] clear remove-mupdate-override from blueprint even if no target release is set (#9082)
Currently: * if a target release is set, we go ahead and clear the remove-mupdate-override instruction from blueprints, regardless of whether artifacts match * if no target release is set, we don't do that This behavior is inconsistent. We shouldn't gate the mupdate override part of the state machine on a target release not being set.
1 parent c7673aa commit 65c8aed

File tree

7 files changed

+403
-17
lines changed

7 files changed

+403
-17
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Test clearing the mupdate override if a target release isn't set.
2+
load-example --nsleds 1 --ndisks-per-sled 3
3+
4+
# Create a TUF repository from a fake manifest. We don't set this as the
5+
# target release; rather, we just MUPdate to it (also setting the mupdate
6+
# override).
7+
tuf-assemble ../../update-common/manifests/fake.toml
8+
sled-update-install-dataset serial0 --from-repo repo-1.0.0.zip
9+
sled-set serial0 mupdate-override 6123eac1-ec5b-42ba-b73f-9845105a9971
10+
11+
# Generate a new inventory and plan against that. This diff will have the
12+
# "will remove mupdate override" message within it.
13+
inventory-generate
14+
blueprint-plan latest latest
15+
blueprint-diff latest
16+
17+
# Now apply the remove-mupdate-override instruction to the sled.
18+
sled-set serial0 mupdate-override unset
19+
20+
# Plan again. This diff should show that the remove-mupdate-override instruction
21+
# was removed from the blueprint.
22+
inventory-generate
23+
blueprint-plan latest latest
24+
blueprint-diff latest

dev-tools/reconfigurator-cli/tests/output/cmds-add-zones-with-mupdate-override-stdout

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ to: blueprint 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1
194194

195195
internal DNS:
196196
DNS zone: "control-plane.oxide.internal" (unchanged)
197-
unchanged names: 51 (records: 65)
197+
unchanged names: 52 (records: 68)
198198

199199
external DNS:
200200
DNS zone: "oxide.example" (unchanged)
@@ -255,7 +255,7 @@ to: blueprint 58d5e830-0884-47d8-a7cd-b2b3751adeb4
255255

256256
internal DNS:
257257
DNS zone: "control-plane.oxide.internal" (unchanged)
258-
unchanged names: 51 (records: 65)
258+
unchanged names: 52 (records: 68)
259259

260260
external DNS:
261261
DNS zone: "oxide.example" (unchanged)
@@ -386,6 +386,14 @@ internal DNS:
386386
* DNS zone: "control-plane.oxide.internal":
387387
+ name: 571a8adf-f0b8-458c-8e6c-5a71e82af7ae.host (records: 1)
388388
+ AAAA fd00:1122:3344:103::28
389+
* name: _nexus-lockstep._tcp (records: 3 -> 4)
390+
- SRV port 12232 0c71b3b2-6ceb-4e8f-b020-b08675e83038.host.control-plane.oxide.internal
391+
- SRV port 12232 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6.host.control-plane.oxide.internal
392+
- SRV port 12232 466a9f29-62bf-4e63-924a-b9efdb86afec.host.control-plane.oxide.internal
393+
+ SRV port 12232 0c71b3b2-6ceb-4e8f-b020-b08675e83038.host.control-plane.oxide.internal
394+
+ SRV port 12232 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6.host.control-plane.oxide.internal
395+
+ SRV port 12232 466a9f29-62bf-4e63-924a-b9efdb86afec.host.control-plane.oxide.internal
396+
+ SRV port 12232 571a8adf-f0b8-458c-8e6c-5a71e82af7ae.host.control-plane.oxide.internal
389397
* name: _nexus._tcp (records: 3 -> 4)
390398
- SRV port 12221 0c71b3b2-6ceb-4e8f-b020-b08675e83038.host.control-plane.oxide.internal
391399
- SRV port 12221 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6.host.control-plane.oxide.internal

dev-tools/reconfigurator-cli/tests/output/cmds-mupdate-override-without-target-release-stderr

Whitespace-only changes.

dev-tools/reconfigurator-cli/tests/output/cmds-mupdate-override-without-target-release-stdout

Lines changed: 353 additions & 0 deletions
Large diffs are not rendered by default.

nexus/reconfigurator/planning/src/blueprint_builder/builder.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::blueprint_editor::NoAvailableDnsSubnets;
1515
use crate::blueprint_editor::SledEditError;
1616
use crate::blueprint_editor::SledEditor;
1717
use crate::mgs_updates::PendingHostPhase2Changes;
18-
use crate::planner::NoopConvertGlobalIneligibleReason;
1918
use crate::planner::NoopConvertInfo;
2019
use crate::planner::NoopConvertSledIneligibleReason;
2120
use crate::planner::ZoneExpungeReason;
@@ -2739,22 +2738,13 @@ impl IdOrdItem for EnsureMupdateOverrideUpdatedZone {
27392738
/// though inventory no longer has the sled.
27402739
#[derive(Clone, Debug, Eq, PartialEq)]
27412740
pub(crate) enum BpMupdateOverrideNotClearedReason {
2742-
/// There is a global reason noop conversions are not possible.
2743-
NoopGlobalIneligible(NoopConvertGlobalIneligibleReason),
2744-
27452741
/// There is a sled-specific reason noop conversions are not possible.
27462742
NoopSledIneligible(NoopConvertSledIneligibleReason),
27472743
}
27482744

27492745
impl fmt::Display for BpMupdateOverrideNotClearedReason {
27502746
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27512747
match self {
2752-
BpMupdateOverrideNotClearedReason::NoopGlobalIneligible(reason) => {
2753-
write!(
2754-
f,
2755-
"no sleds can be noop-converted to Artifact: {reason}",
2756-
)
2757-
}
27582748
BpMupdateOverrideNotClearedReason::NoopSledIneligible(reason) => {
27592749
write!(
27602750
f,

nexus/reconfigurator/planning/src/blueprint_editor/sled_editor.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::blueprint_builder::EditedSledScalarEdits;
99
use crate::blueprint_builder::EnsureMupdateOverrideAction;
1010
use crate::blueprint_builder::EnsureMupdateOverrideUpdatedZone;
1111
use crate::blueprint_builder::SledEditCounts;
12+
use crate::planner::NoopConvertGlobalIneligibleReason;
1213
use crate::planner::NoopConvertSledEligible;
1314
use crate::planner::NoopConvertSledIneligibleReason;
1415
use crate::planner::NoopConvertSledInfoMut;
@@ -980,10 +981,15 @@ impl ActiveSledEditor {
980981
})
981982
}
982983
},
983-
NoopConvertSledInfoMut::GlobalIneligible(reason) => {
984-
Ok(EnsureMupdateOverrideAction::BpOverrideNotCleared {
985-
bp_override,
986-
reason: NoopGlobalIneligible(reason.clone()),
984+
NoopConvertSledInfoMut::GlobalIneligible(
985+
NoopConvertGlobalIneligibleReason::NoTargetRelease,
986+
) => {
987+
// It's fine to clear the override when there's no
988+
// target release, even though noop conversions aren't
989+
// possible.
990+
self.set_remove_mupdate_override(None);
991+
Ok(EnsureMupdateOverrideAction::BpClearOverride {
992+
prev_bp_override: bp_override,
987993
})
988994
}
989995
}

openapi/nexus-lockstep.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5222,6 +5222,10 @@
52225222
"$ref": "#/components/schemas/PlanningAddSufficientZonesExist"
52235223
}
52245224
},
5225+
"target_release_generation_is_one": {
5226+
"description": "Set to true if the target release generation is 1, which would allow zones to be added.",
5227+
"type": "boolean"
5228+
},
52255229
"waiting_on": {
52265230
"nullable": true,
52275231
"description": "What are we waiting on to start zone additions?",
@@ -5243,7 +5247,8 @@
52435247
"sleds_waiting_for_ntp_zone",
52445248
"sleds_without_ntp_zones_in_inventory",
52455249
"sleds_without_zpools_for_ntp_zones",
5246-
"sufficient_zones_exist"
5250+
"sufficient_zones_exist",
5251+
"target_release_generation_is_one"
52475252
]
52485253
},
52495254
"PlanningAddSufficientZonesExist": {

0 commit comments

Comments
 (0)