From d0ee4da932a5a2cd745bdda5bc901eda5dd82e90 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Mon, 18 Jun 2018 08:08:02 -0700 Subject: [PATCH] fix minor issues in custom SD example (#4278) Signed-off-by: Callum Styan --- documentation/examples/custom-sd/adapter-usage/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/examples/custom-sd/adapter-usage/main.go b/documentation/examples/custom-sd/adapter-usage/main.go index 071eb22ec..9a5123eab 100644 --- a/documentation/examples/custom-sd/adapter-usage/main.go +++ b/documentation/examples/custom-sd/adapter-usage/main.go @@ -36,7 +36,7 @@ import ( var ( a = kingpin.New("sd adapter usage", "Tool to generate file_sd target files for unimplemented SD mechanisms.") outputFile = a.Flag("output.file", "Output file for file_sd compatible file.").Default("custom_sd.json").String() - listenAddress = a.Flag("listen.address", "The address the HTTP sd is listening on for requests.").Default("localhost:8080").String() + listenAddress = a.Flag("listen.address", "The address the Consul HTTP API is listening on for requests.").Default("localhost:8500").String() logger log.Logger // addressLabel is the name for the label containing a target's address. @@ -196,7 +196,7 @@ func (d *discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) { } tgs = append(tgs, tg) } - if err != nil { + if err == nil { // We're returning all Consul services as a single targetgroup. ch <- tgs } @@ -236,7 +236,7 @@ func main() { // NOTE: create an instance of your new SD implementation here. cfg := sdConfig{ TagSeparator: ",", - Address: "localhost:8500", + Address: *listenAddress, RefreshInterval: 30, }