Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1661 from advancedtelematic/fix/rm-unnumbered-roo…
Browse files Browse the repository at this point in the history
…t-fetch

Revert "Fetch unnumbered Director root once as a workaround."
  • Loading branch information
pattivacek authored Apr 30, 2020
2 parents d81e2c5 + ba04a15 commit 48c5b67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Our versioning scheme is `YEAR.N` where `N` is incremented whenever a new releas

- Improved garage-deploy object fetching performance by reusing the curl handle: [PR](https://github.com/advancedtelematic/aktualizr/pull/1643)

### Removed

- No longer fetch unnumbered Root metadata from the Director: [PR](https://github.com/advancedtelematic/aktualizr/pull/1661)


## [2020.5] - 2020-04-01

Expand Down
6 changes: 1 addition & 5 deletions src/libaktualizr/uptane/uptane_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1203,11 +1203,7 @@ class HttpFakeUnstable : public HttpFake {
if (unstable_valid_count >= unstable_valid_num) {
return HttpResponse({}, 503, CURLE_OK, "");
} else {
// This if is a hack only required as long as we have to explicitly fetch
// this to make the Director recognize new devices as "online".
if (url.find("director/root.json") == std::string::npos) {
++unstable_valid_count;
}
++unstable_valid_count;
return HttpFake::get(url, maxsize);
}
}
Expand Down
7 changes: 0 additions & 7 deletions src/libaktualizr/uptane/uptanerepository.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,7 @@ void RepositoryCommon::updateRoot(INvStorage& storage, const IMetadataFetcher& f
if (storage.loadLatestRoot(&root_raw, repo_type)) {
initRoot(repo_type, root_raw);
} else {
// This block is a hack only required as long as we have to explicitly
// fetch this to make the Director recognize new devices as "online".
if (repo_type == RepositoryType::Director()) {
fetcher.fetchLatestRole(&root_raw, kMaxRootSize, repo_type, Role::Root());
}

fetcher.fetchRole(&root_raw, kMaxRootSize, repo_type, Role::Root(), Version(1));

initRoot(repo_type, root_raw);
storage.storeRoot(root_raw, repo_type, Version(1));
}
Expand Down

0 comments on commit 48c5b67

Please sign in to comment.