-
Notifications
You must be signed in to change notification settings - Fork 669
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to use backtick instead of regular quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we unpack directly to disk, these layers really need to be verified against the manifest's digest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the mediatypes directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this gives me finer grained control, i.e. typeImageLayout
, and typeImage
don't have media types at all and must be treated differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course!
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this code to follow the spec here: #94
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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