Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API support for managing and tracking artifact manifests in image indexes #1833

Merged
merged 8 commits into from
Feb 5, 2024

Commits on Feb 5, 2024

  1. pkg/manifests.list.preferOCI(): pay attention to annotations in indexes

    Account for the presence of annotations in the OCI version of an index
    or list when deciding if the structure should be saved in OCI format.
    This requires removing an annotation from the test data so that the
    presence of "features" information for one of its instances will be the
    deciding factor.
    
    If we don't take those into account, setting annotations in the index
    doesn't force the index to be saved in OCI format, so even though none
    of the indicators that would force use of the Docker format are present,
    we effectively throw away those annotations by using Docker format
    anyway.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    66f526e View commit details
    Browse the repository at this point in the history
  2. pkg/manifests.List: add SetSubject()/Subject()

    Add methods for reading and writing the index-level "subject" field.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    65086c1 View commit details
    Browse the repository at this point in the history
  3. pkg/manifests.List: use pointers in SetArtifactType()/ArtifactType()

    ... so that `nil` can be used to mark that we want to change the field
    in the image index as a whole rather than on one of the manifests that
    we're tracking.
    
    This is an API change.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    bd17079 View commit details
    Browse the repository at this point in the history
  4. ibimage/manifests.list.Add(): don't read platform info for artifacts

    If an instance being added to a list has a non-empty ArtifactType value
    or a config.MediaType value that isn't one of the known kinds of image
    configuration blobs, don't try to parse the configuration blob to figure
    out the image's OS/Architecture/Variant information.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    79337a5 View commit details
    Browse the repository at this point in the history
  5. libimage/manifests: manage artifact information, too

    Track information about artifacts for which we're managing the artifact
    manifests.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    ad6665b View commit details
    Browse the repository at this point in the history
  6. libimage/manifests.list.SaveToImage(): use ImageOptions

    When saving information about a list, use an ImageOptions structure to
    create the whole thing at once, and only save individual data piece by
    piece if we need to.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    6dd3b87 View commit details
    Browse the repository at this point in the history
  7. libimage/manifests.list: hold artifact manifests

    Add an AddArtifact() method which will craft an artifact manifest which
    references one or more files and then add that manifest to the index.
    
    When we need to build a reference to a list that includes our artifact
    manifests, save the manifests and symlinks to their "layer" blobs along
    with the contents of inlined blobs in a per-image directory, and add
    references to those locations to the list of images we can search for
    manifests and blobs.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    c813258 View commit details
    Browse the repository at this point in the history
  8. libimage.ManifestList.Inspect(): show artifact types and file lists

    When listing instances in an image index, show their artifact types and
    the names of any files that they're tracking.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    af3f5ad View commit details
    Browse the repository at this point in the history