File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import (
1919 "github.com/urfave/cli"
2020)
2121
22+ const specConfig = "config.json"
23+
2224type configCheck func (rspec.Spec , string , bool ) []string
2325
2426var bundleValidateFlags = []cli.Flag {
@@ -77,7 +79,7 @@ var bundleValidateCommand = cli.Command{
7779 return err
7880 }
7981
80- configPath := filepath .Join (inputPath , "config.json" )
82+ configPath := filepath .Join (inputPath , specConfig )
8183 content , err := ioutil .ReadFile (configPath )
8284 if err != nil {
8385 return err
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ import (
2424// the kernel
2525const PR_GET_NO_NEW_PRIVS = 39
2626
27+ const specConfig = "config.json"
28+
2729var (
2830 defaultFS = map [string ]string {
2931 "/proc" : "proc" ,
@@ -47,11 +49,10 @@ var (
4749type validation func (* rspec.Spec ) error
4850
4951func loadSpecConfig () (spec * rspec.Spec , err error ) {
50- cPath := "config.json"
51- cf , err := os .Open (cPath )
52+ cf , err := os .Open (specConfig )
5253 if err != nil {
5354 if os .IsNotExist (err ) {
54- return nil , fmt .Errorf ("config.json not found" )
55+ return nil , fmt .Errorf ("%s not found" , specConfig )
5556 }
5657 }
5758 defer cf .Close ()
You can’t perform that action at this time.
0 commit comments