From 615a632ffc4953b2d6ac172ee5ffe418b369ca6c 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. In order to do an offline query (e.g. in rpm-ostree we want to re-synthesize a higher level summary of the queued update) add an API which allows querying a previously saved cached update. 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 -