Merge pull request #50 from reactiveops/config-flag

add flag for config
This commit is contained in:
Bobby Brennan
2019-04-09 17:52:06 -04:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -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)

View File

@@ -51,6 +51,7 @@ 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,
@@ -58,9 +59,9 @@ func main() {
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)
}