From ba04a1588dcbaaa12f14c7136294077c9b550da5 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Wed, 29 Apr 2020 16:17:48 +0200 Subject: [PATCH] Revert "Fetch unnumbered Director root once as a workaround." This reverts commit b322fa5a7f9188b399f14bd73c3cb2d3423778b0. This is no longer required by the backend, and it's just a waste of bandwidth. Signed-off-by: Patrick Vacek --- CHANGELOG.md | 4 ++++ src/libaktualizr/uptane/uptane_test.cc | 6 +----- src/libaktualizr/uptane/uptanerepository.cc | 7 ------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5576369ae..5a12e0202f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/libaktualizr/uptane/uptane_test.cc b/src/libaktualizr/uptane/uptane_test.cc index 1dcaf16b84..d5c29a1c16 100644 --- a/src/libaktualizr/uptane/uptane_test.cc +++ b/src/libaktualizr/uptane/uptane_test.cc @@ -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); } } diff --git a/src/libaktualizr/uptane/uptanerepository.cc b/src/libaktualizr/uptane/uptanerepository.cc index eecfa560b1..8265a4ecae 100644 --- a/src/libaktualizr/uptane/uptanerepository.cc +++ b/src/libaktualizr/uptane/uptanerepository.cc @@ -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)); }