Skip to content

Commit 0c4b5a8

Browse files
authored
Search new tuf repo before old for zone versions (#8569)
This fixes repo version selection to match what is in `caboose_to_version`. In the case that both repos have the same artifact hash for some reason, we want to show the version for the newer TUF repo.
1 parent 33ecf8f commit 0c4b5a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nexus/types/src/internal_api/views.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,18 +685,18 @@ impl UpdateStatus {
685685
return TufRepoVersion::InstallDataset;
686686
};
687687

688-
if let Some(old) = old.tuf_repo() {
689-
if old.artifacts.iter().any(|meta| meta.hash == hash) {
688+
if let Some(new) = new.tuf_repo() {
689+
if new.artifacts.iter().any(|meta| meta.hash == hash) {
690690
return TufRepoVersion::Version(
691-
old.repo.system_version.clone(),
691+
new.repo.system_version.clone(),
692692
);
693693
}
694694
}
695695

696-
if let Some(new) = new.tuf_repo() {
697-
if new.artifacts.iter().any(|meta| meta.hash == hash) {
696+
if let Some(old) = old.tuf_repo() {
697+
if old.artifacts.iter().any(|meta| meta.hash == hash) {
698698
return TufRepoVersion::Version(
699-
new.repo.system_version.clone(),
699+
old.repo.system_version.clone(),
700700
);
701701
}
702702
}

0 commit comments

Comments
 (0)