From 662aca0b8f0f075312f4c5cbd387b1d750845cf8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 12 Sep 2023 20:53:38 -0400 Subject: [PATCH] container: Cache new manifest/config in prepare, add API to query Closes: https://github.com/ostreedev/ostree-rs-ext/issues/496 In https://github.com/coreos/rpm-ostree/pull/4486 we were working on fixing `rpm-ostree upgrade --check` with containers. However, what we really want here is to *persist* the updated manifest (and config) that we fetch. And if we do that, we might as well just make it part of the current `prepare()` API so it happens automatically. In this change, we do so via detached commit metadata. An important thing here is that the data is then automatically lifecycle bound to the merge commit - and the merge commit always changes when we fetch a new manifest. Then, add this "cached update" metadata to the existing structure which has image state so it can be conveniently queried *without* re-fetching. Hence a flow like this should work: - OS boots - OS updater does a background "check for updates" via calling `prepare()` - OS updater finds an update, and renders metadata to the user or orchestration system -