-
Notifications
You must be signed in to change notification settings - Fork 775
Error out if no validate layers found during unpacking #261
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
Conversation
|
hmmm. Perhaps an INFO or WARN would be better than error. Folks have discussed the possibility of a manifest that references digests of layers that are not provided. Obviously this implies a distribution or discovery of the layers associated with these digests, but that is a different issue to solve. |
|
@vbatts I think it is an error because you can't successfully complete the operation. |
|
hmm, in the case it seems fine. It just ought not imply an image is invalid for not including the layer referenced in the manifest. |
|
This is just for unpacking an oci image layout to a runtime bundle, I think it's make sense to error out because the |
|
@vbatts yes, for validate I 100% agree. For unpack it must error because it can't complete the operation. |
image/manifest.go
Outdated
| } | ||
| } | ||
| return nil | ||
| return fmt.Errorf("no validate layers found") |
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.
I think the error should be like this one: https://github.com/coolljt0725/image-spec/blob/290cb54341fdce2b746a05fc164203843f41dd7e/image/manifest.go#L113
290cb54 to
63a71a7
Compare
|
@philips updated |
Signed-off-by: Lei Jitang <[email protected]>
|
On Mon, Sep 05, 2016 at 08:46:08PM -0700, Lei Jitang wrote:
If the media type was wrong, wouldn't we want to error out here 1? And why is that using MediaTypeImageConfig? Shouldn't it be using The return at the end (outside of the Layers loop) which you touch in |
|
On Wed, Sep 07, 2016 at 02:41:14AM -0700, W. Trevor King wrote:
Ah, this is #257, and yeah, it should be MediaTypeImageLayer. |
The current code may be wrong, if there is a valid layer, it will return from https://github.com/opencontainers/image-spec/pull/261/files#diff-66e5333ade2df0ad4720e022ecd0172bL115 so it never go to https://github.com/opencontainers/image-spec/pull/261/files#diff-66e5333ade2df0ad4720e022ecd0172bR120 I'll open a new pr to fix this |
|
Will need a rework after #274. |
|
@jonboulle yup, will do |
|
On Wed, Sep 07, 2016 at 04:03:37AM -0700, Lei Jitang wrote:
Your fix in #274 looks good to me.
More on “no valid layer found” in 1. If ‘layers’ is empty, having |
Signed-off-by: Lei Jitang [email protected]
Instead of silently finished when
oci-image-tool create-runtime-bundleunpack a oci-layout to a runtime bundle but there is no valid layer(for example the media type of layer is not correct), it's better error out.