From 4bbeb199643ce4519cf974e1f27a67ce111d01ef Mon Sep 17 00:00:00 2001 From: liang chenye Date: Tue, 3 May 2016 16:09:01 +0800 Subject: [PATCH] artifacts must be present in a single directory Signed-off-by: liang chenye --- validate.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/validate.go b/validate.go index af550887d..9b3a6a913 100644 --- a/validate.go +++ b/validate.go @@ -53,7 +53,8 @@ var bundleValidateCommand = cli.Command{ logrus.Fatal(err) } - sf, err := os.Open(path.Join(inputPath, "config.json")) + configPath := path.Join(inputPath, "config.json") + sf, err := os.Open(configPath) if err != nil { logrus.Fatal(err) } @@ -75,6 +76,11 @@ var bundleValidateCommand = cli.Command{ } else if !fi.IsDir() { logrus.Fatalf("Rootfs: %v is not a directory.", spec.Root.Path) } + + if path.Dir(configPath) != path.Dir(rootfsPath) { + logrus.Fatalf("Root filesystem and 'config.json' must be present in a single directory.") + } + bundleValidate(spec, rootfsPath) logrus.Infof("Bundle validation succeeded.") },