Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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.")
},
Expand Down