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

Move label-related logic into a separated package #163

Merged
merged 1 commit into from
Oct 18, 2020

Commits on Oct 17, 2020

  1. Move label-related logic into a separated package

    This commit separates labels-related logic from the filesystem core. This
    introduces a new package `source` and defines a logic to convert snapshot labels
    into blob sources information `source.Source`. `source` package defines an
    interface of that converter (`source.GetSources func(labels map[string]string)
    (source []Source, err error)`), and contains the default implementation based on
    `containerd.io/snapshot/remote/stargz...` labels (which is previously embedded
    in the filesystem core).
    
    Now the filesystem uses `source.GetSources` for acquiring blob source
    information. By default, it uses the implementation by `source` package but it
    accepts any user-defined ones through a constructor option `WithGetSources`.
    
    `containerd-stargz-grpc` uses the following `source.GetSources` implementations.
    - a parser of default labels `containerd.io/snapshot/remote/stargz...`
      (implemented in `source` package).
    - a parser of labels `containerd.io/snapshot/cri...` passed from CRI, which
      previously embedded in the filesystem core.
    
    Another note comes with this change is that the filesystem is now agnostic about
    (source-related) labels. `source.GetSources` implementations aren't required to
    use these labels so they can provide blob source information leveraging other
    media instead of these labels (e.g. using manifest-like JSON data + content
    store).
    
    Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
    ktock committed Oct 17, 2020
    Configuration menu
    Copy the full SHA
    f35a305 View commit details
    Browse the repository at this point in the history