Skip to content

Commit

Permalink
add flag for config
Browse files Browse the repository at this point in the history
add note to readme
  • Loading branch information
rbren committed Apr 9, 2019
1 parent 175cd2b commit a72f048
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ kubectl apply -f deploy/all.yaml

## Options

* `dashboard` Runs the webserver for Fairwinds dashboard.
* `config`: Specify a location for the Fairwinds config
* `dashboard`: Runs the webserver for Fairwinds dashboard.
* `dashboard-port`: Port for the dashboard webserver (default 8080)
* `webhook`: Runs the webhook webserver.
* `webhook-port`: Port for the webhook webserver (default 9876)
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ func main() {
dashboardPort := flag.Int("dashboard-port", 8080, "Port for the dashboard webserver")
webhookPort := flag.Int("webhook-port", 9876, "Port for the webhook webserver")
auditDestination := flag.String("audit-destination", "", "Destination URL to send audit results (prints to stdout if unspecified)")
configPath := flag.String("config", "config.yaml", "Location of Fairwinds configuration file")

var disableWebhookConfigInstaller bool
flag.BoolVar(&disableWebhookConfigInstaller, "disable-webhook-config-installer", false,
"disable the installer in the webhook server, so it won't install webhook configuration resources during bootstrapping")

flag.Parse()

c, err := conf.ParseFile("config.yaml")
c, err := conf.ParseFile(*configPath)
if err != nil {
glog.Println("Error parsing config.yaml:", err)
glog.Println("Error parsing config at " + *configPath, err)
os.Exit(1)
}

Expand Down

0 comments on commit a72f048

Please sign in to comment.