layout: implement unpacking and validation#82
Conversation
bd4afcd to
4aa9e1f
Compare
|
Blocked by #81: I need the config validator merged to thoroughly validate the image/image layout. |
|
@s-urbaniak #81 is merged, what is the next step? |
|
@philips implementing image layout validation now, should be ready by EOD |
|
@philips @vbatts @stevvooe PTAL; I implemented this using self-made image available here https://github.com/s-urbaniak/oci-image-test. |
|
@s-urbaniak Are you generating the OCI Runtime config.json? https://github.com/opencontainers/runtime-spec/blob/master/config.md We need to generate that from the serialization.config thingie. |
|
@philips nope, as discussed OOB, this is just "pure" unpacking. The runtime config.json would have to be solved in a separate PR. |
|
@s-urbaniak I'm looking at this today. Sorry for the delay. |
| info := hdr.FileInfo() | ||
|
|
||
| if strings.HasPrefix(info.Name(), `.wh.`) { | ||
| path = strings.Replace(path, `.wh.`, "", 1) |
There was a problem hiding this comment.
any reason to use backtick instead of regular quotes?
There was a problem hiding this comment.
no reason, just too fast typing ;-) fixed
|
@s-urbaniak This is looking very solid. Is there a corresponding specification for this format? The only large change I'd suggest is that rather than |
| return nil // ignore | ||
| } | ||
|
|
||
| if err := extractLayer(dest, r); err != nil { |
There was a problem hiding this comment.
If we unpack directly to disk, these layers really need to be verified against the manifest's digest.
|
@stevvooe what do you mean by "avoid the half-deserialized manifests"? |
|
@stevvooe are you thinking something like this for the refs schema: |
|
|
||
| // supported autodetection types | ||
| const ( | ||
| typeImageLayout = "imageLayout" |
There was a problem hiding this comment.
Why not use the mediatypes directly?
There was a problem hiding this comment.
this gives me finer grained control, i.e. typeImageLayout, and typeImage don't have media types at all and must be treated differently.
|
@philips I really referring to https://github.com/opencontainers/image-spec/pull/82/files#diff-1d4f0c730d731e154e77caf8c8ce36a4R80. But, I was thinking about something like this: |
|
@stevvooe I think we need an array of media types though as we need a way of emulating Accept with a filesystem. What if my ref is serving a v1 and v1.1 manifest? Let me file a new issue on this. |
|
On Thu, May 26, 2016 at 02:14:36PM -0700, Brandon Philips wrote:
Make the root reference point to a manifest.list 1? |
|
@wking I think that is the approach we are going to take. Let me work up a proposal. |
| } | ||
|
|
||
| func diffIDs(w walker, manifest string) ([]string, error) { | ||
| manifest = filepath.Join("manifests", manifest) |
There was a problem hiding this comment.
can you change this code to follow the spec here: #94
Fixes opencontainers#75 Signed-off-by: Sergiusz Urbaniak <sur@coreos.com>
|
Overall LGTM for a starting point. Anyone else give this an LGTM @opencontainers/image-spec-maintainers |
|
LGTM |
Fixes #75
Signed-off-by: Sergiusz Urbaniak sur@coreos.com