Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from jschwinger23/zc/fix
Browse files Browse the repository at this point in the history
Add launch flag "--enable-cni"
  • Loading branch information
雾雨 authored Jul 6, 2021
2 parents 05efc8b + 721b03b commit 08ffd6e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions barrel.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ func run(c *cli.Context) (err error) {
if err != nil {
return
}
cniConf, err := config.LoadConfig(c.String("cni-config"))
if err != nil {
return
cniConf := config.Config{}
if c.Bool("enable-cni") {
cniConf, err = config.LoadConfig(c.String("cni-config"))
if err != nil {
return
}
}

barrel := app.Application{
Expand Down Expand Up @@ -189,6 +192,12 @@ func main() {
Usage: "enable cnm agent",
EnvVars: []string{"BARREL_ENABLE_CNM_AGENT"},
},
&cli.BoolFlag{
Name: "enable-cni",
Value: false,
Usage: "enable cni network",
EnvVars: []string{"BARREL_ENABLE_CNI"},
},
&cli.StringFlag{
Name: "cni-config",
Value: "/etc/docker/cni.yaml",
Expand Down

0 comments on commit 08ffd6e

Please sign in to comment.