Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Relocation the right way #765

Merged
merged 5 commits into from
Nov 28, 2019

Commits on Nov 27, 2019

  1. remove store2, use readable names

    Signed-off-by: Yves Brissaud <[email protected]>
    eunomie committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    bc0a6bf View commit details
    Browse the repository at this point in the history
  2. remove usage of image-map.json file

    `cnab-go` adds two files to the invocation image:
    - `/cnab/bundle.json`: containing the whole `bundle.json`
    - `/cnab/app/image-map.json`: containing `Images` section of the bundle
    
    As this second file is only an extract of the Bundle it can safely be removed.
    
    The full removal needs to be done in `cnab-go`, here we only ignore it.
    
    Signed-off-by: Yves Brissaud <[email protected]>
    eunomie committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    f7b4189 View commit details
    Browse the repository at this point in the history
  3. apply relocation map at runtime

    Bundle definition -with service image definitions- is mounted under
    `/cnab/bundle.json` in the invocation image.
    If a `/cnab/app/relocation-mapping.json` exists read it and apply it
    on top of image definitions.
    
    See https://github.com/cnabio/cnab-spec/blob/master/103-bundle-runtime.md#image-relocation
    
    Signed-off-by: Yves Brissaud <[email protected]>
    eunomie committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    e404042 View commit details
    Browse the repository at this point in the history
  4. embed relocation map instead of applying it

    Embed the relocation map inside `/cnab/app/relocation-mapping.json`
    and do not touch the bundle definition.
    
    Signed-off-by: Yves Brissaud <[email protected]>
    eunomie committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    5361689 View commit details
    Browse the repository at this point in the history
  5. use relocation map to pull invocation image

    Invocation image can be relocated. The relocation map about services is now applied
    at runtime by `cnab-run`, when running inside the invocation image.
    
    This change updates the invocation image definition in the `driver.Operation`
    using the relocation map if exists. So that the image can be pulled and run.
    
    Signed-off-by: Yves Brissaud <[email protected]>
    eunomie committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    39c87cb View commit details
    Browse the repository at this point in the history