Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Conversation

@coolljt0725
Copy link
Member

The image spec requries that

MUST be set to layers. Implementations MUST generate an error if
they encounter a unknown value while verifying or unpacking an image.

The image-tool should act as the image spec says.

Signed-off-by: Lei Jiang [email protected]

The image spec requries that
````
MUST be set to layers. Implementations MUST generate an error if
they encounter a unknown value while verifying or unpacking an image.
```
The image-tool should act as the image spec says.

Signed-off-by: Lei Jiang <[email protected]>
}
// check if the rootfs type is 'layers'
if c.RootFS.Type != "layers" {
return fmt.Errorf("'%s' is an unknown rootfs type, MUST be 'layers'", c.RootFS.Type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'%s'%q.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a string. granted the %q would put it in quotes, but this seems fine for now.

@vbatts
Copy link
Member

vbatts commented Oct 6, 2016

LGTM

@vbatts vbatts merged commit bf96365 into opencontainers:master Oct 6, 2016
@coolljt0725 coolljt0725 deleted the error_out_not_layers branch October 8, 2016 01:29
@zhouhao3
Copy link

zhouhao3 commented Oct 21, 2016

it's checked in JSON Schema ,need to check it here?

@wking
Copy link
Contributor

wking commented Oct 21, 2016

On Thu, Oct 20, 2016 at 11:57:24PM -0700, Zhou Hao wrote:

it's checked in JSON Schema…

It is checked in JSON Schema since opencontainers/image-spec#358, which landed a day after this PR. So once we bump the vendored image-spec dependency to pull in opencontainers/image-spec#358 we can revert this PR. I think we want a policy for handling these image-spec validation bugs cleanly going forward (opencontainers/image-spec#406).

@zhouhao3
Copy link

I think these fixed values(Such as SchemaVersion and MediaType,and so on) should be checked in JSON Schema.

@wking
Copy link
Contributor

wking commented Oct 21, 2016

On Fri, Oct 21, 2016 at 12:20:36AM -0700, Zhou Hao wrote:

I think these fixed values (Such as SchemaVersion and MediaType,and so on) should be checked in JSON Schema.

And in image-spec's master, they are. But in image-tool's master (pulling in opencontainers/image-spec@7e6e2f76d6, v1.0.0-rc1~18), they are not (and are checked by the code which landed via this PR). Once image-spec cuts v1.0.0-rc2 and image-tools bumps its dependency to pull in that release, we can drop the local check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants