Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

container: Cache new manifest/config in prepare, add API to query #537

Merged
merged 1 commit into from
Sep 18, 2023

Commits on Sep 13, 2023

  1. container: Cache new manifest/config in prepare, add API to query

    Closes: ostreedev#496
    
    In coreos/rpm-ostree#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
    - <time passes; OS update is not downloaded - e.g. user is on
       metered data or whatever>
    - system reboots for other reasons
    - OS updater can re-render the fact that a queued update was
      found *without* touching the network
    
    There's one notable piece that is missing to do conveniently:
    
    - User can initiate a full fetch (e.g. including image layers)
      targeting *exactly* the previously prepared fetch.  This
      makes things much more race-free; if the image was GC'd
      in the meantime we correctly fail.
    
    But it can be done manually by e.g. using a digested pull spec
    temporarily.
    cgwalters committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    662aca0 View commit details
    Browse the repository at this point in the history