From f2530f19f66047cf073111f6f5d446940c2e4dc0 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Fri, 30 Sep 2016 05:27:07 -0400 Subject: [PATCH] Error out if rootfs type is not layers 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 --- image/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/image/config.go b/image/config.go index 14e41e2..c6c7e86 100644 --- a/image/config.go +++ b/image/config.go @@ -53,6 +53,10 @@ func findConfig(w walker, d *descriptor) (*config, error) { if err := json.Unmarshal(buf, &c); err != nil { return err } + // 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) + } return errEOW }); err { case nil: