-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
feea82f
to
ead765c
Compare
I don't understand two other tasks: |
@OYTIS can probably explain better than I can! |
Current workflow of scheduling an update to director in aktualizr-repo is as following:
So there are two problems here:
So I imagined two new commands:
|
Codecov Report
@@ Coverage Diff @@
## master #1035 +/- ##
==========================================
+ Coverage 82.26% 82.33% +0.07%
==========================================
Files 196 196
Lines 13794 13928 +134
==========================================
+ Hits 11347 11467 +120
- Misses 2447 2461 +14
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, looks good!
src/aktualizr_repo/main.cc
Outdated
("keytype", po::value<std::string>()->default_value("RSA2048"), "UPTANE key type") | ||
("targetname", po::value<std::string>(), "target's name") | ||
("targethash", po::value<std::string>(), "target's hash") | ||
("targetlength", po::value<uint64_t>(), "target's length"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three new options should have some explanation here that they are intended for a special purpose. Something like "target name (for adding metadata without an actual file)".
src/aktualizr_repo/image_repo.cc
Outdated
@@ -44,4 +50,17 @@ void ImageRepo::addImage(const boost::filesystem::path &image_path) { | |||
timestamp["meta"]["snapshot.json"]["version"] = snapshot["version"].asUInt(); | |||
Utils::writeFile(repo_dir / "timestamp.json", | |||
Utils::jsonToCanonicalStr(signTuf(Uptane::Role::Timestamp(), timestamp))); | |||
} | |||
|
|||
void ImageRepo::addImage(const std::string &name, const std::string &hash, uint64_t length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not big, but looks like length
can be const
.
@OYTIS Thanks, now I understand. |
ead765c
to
6805d65
Compare
Looks like I have added all commands |
@patriotyk if Travis is giving you trouble, rebase so that you get Laurent's fix to speed up the aktualizr-repo test. |
Are there is something to fix? |
@@ -8,6 +8,10 @@ class ImageRepo : public Repo { | |||
ImageRepo(boost::filesystem::path path, const std::string &expires, std::string correlation_id) | |||
: Repo(Uptane::RepositoryType::Image(), std::move(path), expires, std::move(correlation_id)) {} | |||
void addImage(const boost::filesystem::path &image_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like too much overloading of this addImage
.
Could be helpful to give them different names.
src/aktualizr_repo/image_repo.cc
Outdated
void ImageRepo::addImage(const std::string &name, const std::string &hash, const uint64_t length) { | ||
Json::Value target; | ||
target["length"] = Json::UInt(length); | ||
if (hash.size() == 64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really elegant... Could we use Uptane::Hash
and have too separate arguments on the commandline, like targetsha256
and targetsha512
, or does it make cli handling too complicated?
Looks fine to me, except for the two small comments. If you make changes again, I can take a quick look on Friday. |
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
e892cb3
to
b634fb5
Compare
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
b634fb5
to
f577ed0
Compare
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
f577ed0
to
e79fa6f
Compare
No description provided.