Skip to content

Commit 4bbeb19

Browse files
committed
artifacts must be present in a single directory
Signed-off-by: liang chenye <liangchenye@huawei.com>
1 parent 30dfd9a commit 4bbeb19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

validate.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ var bundleValidateCommand = cli.Command{
5353
logrus.Fatal(err)
5454
}
5555

56-
sf, err := os.Open(path.Join(inputPath, "config.json"))
56+
configPath := path.Join(inputPath, "config.json")
57+
sf, err := os.Open(configPath)
5758
if err != nil {
5859
logrus.Fatal(err)
5960
}
@@ -75,6 +76,11 @@ var bundleValidateCommand = cli.Command{
7576
} else if !fi.IsDir() {
7677
logrus.Fatalf("Rootfs: %v is not a directory.", spec.Root.Path)
7778
}
79+
80+
if path.Dir(configPath) != path.Dir(rootfsPath) {
81+
logrus.Fatalf("Root filesystem and 'config.json' must be present in a single directory.")
82+
}
83+
7884
bundleValidate(spec, rootfsPath)
7985
logrus.Infof("Bundle validation succeeded.")
8086
},

0 commit comments

Comments
 (0)