Skip to content

Commit cc74a95

Browse files
committed
make set_target_release_and_old_repo the default behavior
Previously, we had `set_target_release` and `set_target_release_and_old_repo` for reconfigurator-cli because there were concerns about the behavior of the system if the old repo was set during the middle of an update. This has since been fixed and the behavior of `set_target_release_and_old_repo` is what we should use everywhere
1 parent 5472a8a commit cc74a95

2 files changed

Lines changed: 5 additions & 32 deletions

File tree

nexus/reconfigurator/planning/src/system.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -869,33 +869,6 @@ impl SystemDescription {
869869
pub fn set_target_release(
870870
&mut self,
871871
description: TargetReleaseDescription,
872-
) -> &mut Self {
873-
// Create a new TufRepoPolicy by bumping the generation.
874-
let new_repo = TufRepoPolicy {
875-
target_release_generation: self
876-
.tuf_repo
877-
.target_release_generation
878-
.next(),
879-
description,
880-
};
881-
882-
let _old_repo = self.set_tuf_repo_inner(new_repo);
883-
884-
// It's tempting to consider setting old_repo to the current tuf_repo,
885-
// but that requires the invariant that old_repo is always the current
886-
// target release and that an update isn't currently in progress. See
887-
// https://github.com/oxidecomputer/omicron/issues/8056 for some
888-
// discussion.
889-
//
890-
// We provide a method to set the old repo explicitly with these
891-
// assumptions in mind: `set_target_release_and_old_repo`.
892-
893-
self
894-
}
895-
896-
pub fn set_target_release_and_old_repo(
897-
&mut self,
898-
description: TargetReleaseDescription,
899872
) -> &mut Self {
900873
let new_repo = TufRepoPolicy {
901874
target_release_generation: self

nexus/reconfigurator/planning/tests/integration_tests/planner.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,7 +3158,7 @@ fn test_update_crucible_pantry_before_nexus() {
31583158
artifacts,
31593159
});
31603160
sim.change_description("set new target release", |desc| {
3161-
desc.set_target_release_and_old_repo(description);
3161+
desc.set_target_release(description);
31623162
Ok(())
31633163
})
31643164
.unwrap();
@@ -3530,7 +3530,7 @@ fn test_update_cockroach() {
35303530
artifacts,
35313531
});
35323532
sim.change_description("set new target release", |desc| {
3533-
desc.set_target_release_and_old_repo(description);
3533+
desc.set_target_release(description);
35343534
Ok(())
35353535
})
35363536
.unwrap();
@@ -3900,7 +3900,7 @@ fn test_update_boundary_ntp() {
39003900
artifacts,
39013901
});
39023902
sim.change_description("set new target release", |desc| {
3903-
desc.set_target_release_and_old_repo(description);
3903+
desc.set_target_release(description);
39043904
Ok(())
39053905
})
39063906
.unwrap();
@@ -4290,7 +4290,7 @@ fn test_update_internal_dns() {
42904290
artifacts,
42914291
});
42924292
sim.change_description("set new target release", |desc| {
4293-
desc.set_target_release_and_old_repo(description);
4293+
desc.set_target_release(description);
42944294
Ok(())
42954295
})
42964296
.unwrap();
@@ -4539,7 +4539,7 @@ fn test_update_all_zones() {
45394539
});
45404540

45414541
sim.change_description("set new target release", |desc| {
4542-
desc.set_target_release_and_old_repo(description);
4542+
desc.set_target_release(description);
45434543
Ok(())
45444544
})
45454545
.unwrap();

0 commit comments

Comments
 (0)