From 3889705c229e3ff0546be0a19045531469e8246c Mon Sep 17 00:00:00 2001 From: Brian Akins Date: Sun, 29 Jul 2018 15:58:01 -0400 Subject: [PATCH] Change flag name to metrics-address --- README.md | 2 +- main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 798c631c..c58f68b6 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ If you want to increase or decrease the amount of chaos change the interval betw Remember that `chaoskube` by default kills any pod in all your namespaces, including system pods and itself. -`chaoskube` provides a simple HTTP endpoint that can be used to check that it is running. This can be used for [Kubernetes liveness and readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/). By default, this listens on port 8080. To disable, pass `--address=""` to `chaoskube`. +`chaoskube` provides a simple HTTP endpoint that can be used to check that it is running. This can be used for [Kubernetes liveness and readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/). By default, this listens on port 8080. To disable, pass `--metrics-address=""` to `chaoskube`. ## Filtering targets diff --git a/main.go b/main.go index 3e808702..adf2d4da 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,7 @@ var ( interval time.Duration dryRun bool debug bool - address string + metricsAddress string ) func init() { @@ -54,7 +54,7 @@ func init() { kingpin.Flag("interval", "Interval between Pod terminations").Default("10m").DurationVar(&interval) kingpin.Flag("dry-run", "If true, don't actually do anything.").Default("true").BoolVar(&dryRun) kingpin.Flag("debug", "Enable debug logging.").BoolVar(&debug) - kingpin.Flag("address", "Listening address for health check handler").Default(":8080").StringVar(&address) + kingpin.Flag("metrics-address", "Listening address for metrics handler").Default(":8080").StringVar(&metricsAddress) } func main() { @@ -153,13 +153,13 @@ func main() { dryRun, ) - if address != "" { + if metricsAddress != "" { http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") }) go func() { - if err := http.ListenAndServe(address, nil); err != nil { + if err := http.ListenAndServe(metricsAddress, nil); err != nil { log.WithFields(log.Fields{ "err": err, }).Fatal("failed to start HTTP server")