Skip to content

Commit

Permalink
added listening address
Browse files Browse the repository at this point in the history
  • Loading branch information
makoscafee committed Jan 29, 2021
1 parent 512a5f2 commit 23d7659
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 111 deletions.
4 changes: 3 additions & 1 deletion cmd/polaris/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import (
var serverPort int
var basePath string
var loadAuditFile string
var listeningAddress string

func init() {
rootCmd.AddCommand(dashboardCmd)
dashboardCmd.PersistentFlags().IntVarP(&serverPort, "port", "p", 8080, "Port for the dashboard webserver.")
dashboardCmd.PersistentFlags().StringVar(&listeningAddress, "listening-address", "127.0.0.1", "Port for the dashboard webserver.")
dashboardCmd.PersistentFlags().StringVar(&basePath, "base-path", "/", "Path on which the dashboard is served.")
dashboardCmd.PersistentFlags().StringVar(&loadAuditFile, "load-audit-file", "", "Runs the dashboard with data saved from a past audit.")
dashboardCmd.PersistentFlags().StringVar(&auditPath, "audit-path", "", "If specified, audits one or more YAML files instead of a cluster.")
Expand Down Expand Up @@ -59,6 +61,6 @@ var dashboardCmd = &cobra.Command{
http.Handle("/", router)

logrus.Infof("Starting Polaris dashboard server on port %d", serverPort)
logrus.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", serverPort), nil))
logrus.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", listeningAddress, serverPort), nil))
},
}
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.1.3 // indirect
github.com/googleapis/gnostic v0.5.3 // indirect
github.com/gophercloud/gophercloud v0.15.0 // indirect
github.com/gorilla/mux v1.8.0
github.com/imdario/mergo v0.3.11 // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/prometheus/client_golang v1.9.0 // indirect
github.com/qri-io/jsonschema v0.1.1
github.com/rogpeppe/go-internal v1.6.2 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v1.1.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
gitlab.com/golang-commonmark/linkify v0.0.0-20200225224916-64bca66f6ad3 // indirect
gitlab.com/golang-commonmark/markdown v0.0.0-20191127184510-91b5b3c99c19
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
Expand Down
Loading

0 comments on commit 23d7659

Please sign in to comment.