Skip to content

Commit 1a5e243

Browse files
committed
refact: print details of missing app blobs
If the `composectl check` determines that some of the app blobs are missing, then print their details. It helps to troubleshot issues in case if it is expected that all blobs are present in a local store. Signed-off-by: Mike Sul <mike.sul@foundries.io>
1 parent af42af1 commit 1a5e243

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/composeapp/appengine.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,16 @@ bool AppEngine::isAppFetched(const App& app) const {
176176
exec(boost::format{"%s --store %s check %s --local --format json"} % composectl_cmd_ % storeRoot() % app.uri, "",
177177
"", &output);
178178
const auto app_fetch_status{parseJSON(output)};
179-
if (app_fetch_status.isMember("fetch_check") && app_fetch_status["fetch_check"].isMember("missing_blobs") &&
180-
app_fetch_status["fetch_check"]["missing_blobs"].empty()) {
181-
res = true;
182-
fetched_apps_.insert(app.uri);
179+
if (app_fetch_status.isMember("fetch_check") && app_fetch_status["fetch_check"].isMember("missing_blobs")) {
180+
if (app_fetch_status["fetch_check"]["missing_blobs"].empty()) {
181+
res = true;
182+
fetched_apps_.insert(app.uri);
183+
} else {
184+
LOG_INFO << "Missing blobs of " << app.uri;
185+
for (const auto& blob : app_fetch_status["fetch_check"]["missing_blobs"]) {
186+
LOG_INFO << " - " << blob["descriptor"]["digest"] << ", size: " << blob["descriptor"]["size"];
187+
}
188+
}
183189
}
184190
} catch (const ExecError& exc) {
185191
LOG_DEBUG << "app is not fully fetched; app: " << app.name << ", status: " << exc.what();

0 commit comments

Comments
 (0)