From 74fa670310a131cfc15375bb23d5c8741128f0b7 Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Thu, 7 May 2020 15:47:39 -0700 Subject: [PATCH 1/2] Extract http flags from consul/command pkg This decouples us from an internal Consul package. We've removed flags that we aren't using. --- go.mod | 2 + subcommand/acl-init/command.go | 7 +- .../create-federation-secret/command.go | 12 +- subcommand/delete-completed-job/command.go | 7 +- subcommand/flags/flag_duration_value.go | 64 ++++++++ subcommand/flags/flag_map_value.go | 40 +++++ subcommand/flags/flag_map_value_test.go | 83 ++++++++++ subcommand/flags/flag_slice_value.go | 23 +++ subcommand/flags/flag_slice_value_test.go | 38 +++++ subcommand/flags/flags.go | 2 + subcommand/flags/http.go | 144 ++++++++++++++++++ subcommand/flags/k8s.go | 4 +- subcommand/flags/usage.go | 117 ++++++++++++++ subcommand/get-consul-client-ca/command.go | 2 +- subcommand/inject-connect/command.go | 5 +- subcommand/lifecycle-sidecar/command.go | 6 +- subcommand/lifecycle-sidecar/command_test.go | 6 - subcommand/server-acl-init/command.go | 2 +- subcommand/service-address/command.go | 2 +- subcommand/sync-catalog/command.go | 10 +- 20 files changed, 537 insertions(+), 39 deletions(-) create mode 100644 subcommand/flags/flag_duration_value.go create mode 100644 subcommand/flags/flag_map_value.go create mode 100644 subcommand/flags/flag_map_value_test.go create mode 100644 subcommand/flags/flag_slice_value.go create mode 100644 subcommand/flags/flag_slice_value_test.go create mode 100644 subcommand/flags/flags.go create mode 100644 subcommand/flags/http.go create mode 100644 subcommand/flags/usage.go diff --git a/go.mod b/go.mod index 6c52d0ce26..e7ae78f33b 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,11 @@ require ( github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect github.com/json-iterator/go v1.1.8 // indirect + github.com/kr/text v0.1.0 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a github.com/mitchellh/cli v1.0.0 github.com/mitchellh/go-homedir v1.1.0 + github.com/mitchellh/mapstructure v1.1.2 github.com/onsi/ginkgo v1.10.3 // indirect github.com/onsi/gomega v1.7.1 // indirect github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 diff --git a/subcommand/acl-init/command.go b/subcommand/acl-init/command.go index 2825ac12b3..bcf41fae0f 100644 --- a/subcommand/acl-init/command.go +++ b/subcommand/acl-init/command.go @@ -12,8 +12,7 @@ import ( "time" "github.com/hashicorp/consul-k8s/subcommand" - k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" - "github.com/hashicorp/consul/command/flags" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/mitchellh/cli" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -23,7 +22,7 @@ type Command struct { UI cli.Ui flags *flag.FlagSet - k8s *k8sflags.K8SFlags + k8s *flags.K8SFlags flagSecretName string flagInitType string flagNamespace string @@ -49,7 +48,7 @@ func (c *Command) init() { c.flags.StringVar(&c.flagTokenSinkFile, "token-sink-file", "", "Optional filepath to write acl token") - c.k8s = &k8sflags.K8SFlags{} + c.k8s = &flags.K8SFlags{} flags.Merge(c.flags, c.k8s.Flags()) c.help = flags.Usage(help, c.flags) } diff --git a/subcommand/create-federation-secret/command.go b/subcommand/create-federation-secret/command.go index 0ecefc6eb1..17924de105 100644 --- a/subcommand/create-federation-secret/command.go +++ b/subcommand/create-federation-secret/command.go @@ -14,9 +14,8 @@ import ( "github.com/cenkalti/backoff" "github.com/hashicorp/consul-k8s/subcommand" "github.com/hashicorp/consul-k8s/subcommand/common" - k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" corev1 "k8s.io/api/core/v1" @@ -38,7 +37,7 @@ var retryInterval = 1 * time.Second type Command struct { UI cli.Ui flags *flag.FlagSet - k8s *k8sflags.K8SFlags + k8s *flags.K8SFlags http *flags.HTTPFlags // flagExportReplicationToken controls whether we include the acl replication @@ -90,12 +89,11 @@ func (c *Command) init() { "Log verbosity level. Supported values (in order of detail) are \"trace\", "+ "\"debug\", \"info\", \"warn\", and \"error\".") - c.help = flags.Usage(help, c.flags) c.http = &flags.HTTPFlags{} - c.k8s = &k8sflags.K8SFlags{} - flags.Merge(c.flags, c.http.ClientFlags()) - flags.Merge(c.flags, c.http.ServerFlags()) + c.k8s = &flags.K8SFlags{} + flags.Merge(c.flags, c.http.Flags()) flags.Merge(c.flags, c.k8s.Flags()) + c.help = flags.Usage(help, c.flags) } // Run creates a Kubernetes secret with data needed by secondary datacenters diff --git a/subcommand/delete-completed-job/command.go b/subcommand/delete-completed-job/command.go index 7b34fa8f43..6144bd8c4c 100644 --- a/subcommand/delete-completed-job/command.go +++ b/subcommand/delete-completed-job/command.go @@ -5,8 +5,7 @@ import ( "flag" "fmt" "github.com/hashicorp/consul-k8s/subcommand" - k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" - "github.com/hashicorp/consul/command/flags" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" v1 "k8s.io/api/batch/v1" @@ -24,7 +23,7 @@ type Command struct { UI cli.Ui flags *flag.FlagSet - k8s *k8sflags.K8SFlags + k8s *flags.K8SFlags flagNamespace string flagTimeout string @@ -39,7 +38,7 @@ type Command struct { func (c *Command) init() { c.flags = flag.NewFlagSet("", flag.ContinueOnError) - c.k8s = &k8sflags.K8SFlags{} + c.k8s = &flags.K8SFlags{} c.flags.StringVar(&c.flagNamespace, "k8s-namespace", "", "Name of Kubernetes namespace where the job is deployed") c.flags.StringVar(&c.flagTimeout, "timeout", "30m", diff --git a/subcommand/flags/flag_duration_value.go b/subcommand/flags/flag_duration_value.go new file mode 100644 index 0000000000..dd3dff27b0 --- /dev/null +++ b/subcommand/flags/flag_duration_value.go @@ -0,0 +1,64 @@ +package flags + +import ( + "reflect" + "time" + + "github.com/mitchellh/mapstructure" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_duration_value.go +// This was done so we don't depend on internal Consul implementation. + +// DurationValue provides a flag value that's aware if it has been set. +type DurationValue struct { + v *time.Duration +} + +// Merge will overlay this value if it has been set. +func (d *DurationValue) Merge(onto *time.Duration) { + if d.v != nil { + *onto = *(d.v) + } +} + +// Set implements the flag.Value interface. +func (d *DurationValue) Set(v string) error { + if d.v == nil { + d.v = new(time.Duration) + } + var err error + *(d.v), err = time.ParseDuration(v) + return err +} + +// String implements the flag.Value interface. +func (d *DurationValue) String() string { + var current time.Duration + if d.v != nil { + current = *(d.v) + } + return current.String() +} + +// StringToDurationValueFunc is a mapstructure hook that looks for an incoming +// string mapped to a DurationValue and does the translation. +func StringToDurationValueFunc() mapstructure.DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + + val := DurationValue{} + if t != reflect.TypeOf(val) { + return data, nil + } + if err := val.Set(data.(string)); err != nil { + return nil, err + } + return val, nil + } +} diff --git a/subcommand/flags/flag_map_value.go b/subcommand/flags/flag_map_value.go new file mode 100644 index 0000000000..26741abce8 --- /dev/null +++ b/subcommand/flags/flag_map_value.go @@ -0,0 +1,40 @@ +package flags + +import ( + "flag" + "fmt" + "strings" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_map_value.go +// This was done so we don't depend on internal Consul implementation. + +// Ensure implements +var _ flag.Value = (*FlagMapValue)(nil) + +// FlagMapValue is a flag implementation used to provide key=value semantics +// multiple times. +type FlagMapValue map[string]string + +func (h *FlagMapValue) String() string { + return fmt.Sprintf("%v", *h) +} + +func (h *FlagMapValue) Set(value string) error { + idx := strings.Index(value, "=") + if idx == -1 { + return fmt.Errorf("Missing \"=\" value in argument: %s", value) + } + + key, value := value[0:idx], value[idx+1:] + + if *h == nil { + *h = make(map[string]string) + } + + headers := *h + headers[key] = value + *h = headers + + return nil +} diff --git a/subcommand/flags/flag_map_value_test.go b/subcommand/flags/flag_map_value_test.go new file mode 100644 index 0000000000..9871bef511 --- /dev/null +++ b/subcommand/flags/flag_map_value_test.go @@ -0,0 +1,83 @@ +package flags + +import ( + "fmt" + "testing" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_map_value_test.go +// This was done so we don't depend on internal Consul implementation. + +func TestFlagMapValueSet(t *testing.T) { + t.Parallel() + + t.Run("missing =", func(t *testing.T) { + + f := new(FlagMapValue) + if err := f.Set("foo"); err == nil { + t.Fatal("expected error, got nil") + } + }) + + t.Run("sets", func(t *testing.T) { + + f := new(FlagMapValue) + if err := f.Set("foo=bar"); err != nil { + t.Fatal(err) + } + + r, ok := (*f)["foo"] + if !ok { + t.Errorf("missing value: %#v", f) + } + if exp := "bar"; r != exp { + t.Errorf("expected %q to be %q", r, exp) + } + }) + + t.Run("sets multiple", func(t *testing.T) { + + f := new(FlagMapValue) + + r := map[string]string{ + "foo": "bar", + "zip": "zap", + "cat": "dog", + } + + for k, v := range r { + if err := f.Set(fmt.Sprintf("%s=%s", k, v)); err != nil { + t.Fatal(err) + } + } + + for k, v := range r { + r, ok := (*f)[k] + if !ok { + t.Errorf("missing value %q: %#v", k, f) + } + if exp := v; r != exp { + t.Errorf("expected %q to be %q", r, exp) + } + } + }) + + t.Run("overwrites", func(t *testing.T) { + + f := new(FlagMapValue) + if err := f.Set("foo=bar"); err != nil { + t.Fatal(err) + } + if err := f.Set("foo=zip"); err != nil { + t.Fatal(err) + } + + r, ok := (*f)["foo"] + if !ok { + t.Errorf("missing value: %#v", f) + } + if exp := "zip"; r != exp { + t.Errorf("expected %q to be %q", r, exp) + } + }) +} diff --git a/subcommand/flags/flag_slice_value.go b/subcommand/flags/flag_slice_value.go new file mode 100644 index 0000000000..880297671c --- /dev/null +++ b/subcommand/flags/flag_slice_value.go @@ -0,0 +1,23 @@ +package flags + +import "strings" + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_slice_value.go +// This was done so we don't depend on internal Consul implementation. + +// AppendSliceValue implements the flag.Value interface and allows multiple +// calls to the same variable to append a list. +type AppendSliceValue []string + +func (s *AppendSliceValue) String() string { + return strings.Join(*s, ",") +} + +func (s *AppendSliceValue) Set(value string) error { + if *s == nil { + *s = make([]string, 0, 1) + } + + *s = append(*s, value) + return nil +} diff --git a/subcommand/flags/flag_slice_value_test.go b/subcommand/flags/flag_slice_value_test.go new file mode 100644 index 0000000000..58c05c8303 --- /dev/null +++ b/subcommand/flags/flag_slice_value_test.go @@ -0,0 +1,38 @@ +package flags + +import ( + "flag" + "reflect" + "testing" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_slice_value_test.go +// This was done so we don't depend on internal Consul implementation. + +func TestAppendSliceValue_implements(t *testing.T) { + t.Parallel() + var raw interface{} + raw = new(AppendSliceValue) + if _, ok := raw.(flag.Value); !ok { + t.Fatalf("AppendSliceValue should be a Value") + } +} + +func TestAppendSliceValueSet(t *testing.T) { + t.Parallel() + sv := new(AppendSliceValue) + err := sv.Set("foo") + if err != nil { + t.Fatalf("err: %s", err) + } + + err = sv.Set("bar") + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := []string{"foo", "bar"} + if !reflect.DeepEqual([]string(*sv), expected) { + t.Fatalf("Bad: %#v", sv) + } +} diff --git a/subcommand/flags/flags.go b/subcommand/flags/flags.go new file mode 100644 index 0000000000..e290e876d7 --- /dev/null +++ b/subcommand/flags/flags.go @@ -0,0 +1,2 @@ +// Package flags holds common flags that are shared between our commands. +package flags diff --git a/subcommand/flags/http.go b/subcommand/flags/http.go new file mode 100644 index 0000000000..e48c699032 --- /dev/null +++ b/subcommand/flags/http.go @@ -0,0 +1,144 @@ +package flags + +import ( + "flag" + "io/ioutil" + "strings" + + "github.com/hashicorp/consul/api" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/http.go +// with flags we don't use removed. This was done so we don't depend on internal +// Consul implementation. + +// HTTPFlags are flags used to configure communication with a Consul agent. +type HTTPFlags struct { + address StringValue + token StringValue + tokenFile StringValue + caFile StringValue + caPath StringValue + tlsServerName StringValue +} + +func (f *HTTPFlags) Flags() *flag.FlagSet { + fs := flag.NewFlagSet("", flag.ContinueOnError) + fs.Var(&f.address, "http-addr", + "The `address` and port of the Consul HTTP agent. The value can be an IP "+ + "address or DNS address, but it must also include the port. This can "+ + "also be specified via the CONSUL_HTTP_ADDR environment variable. The "+ + "default value is http://127.0.0.1:8500. The scheme can also be set to "+ + "HTTPS by setting the environment variable CONSUL_HTTP_SSL=true.") + fs.Var(&f.token, "token", + "ACL token to use in the request. This can also be specified via the "+ + "CONSUL_HTTP_TOKEN environment variable. If unspecified, the query will "+ + "default to the token of the Consul agent at the HTTP address.") + fs.Var(&f.tokenFile, "token-file", + "File containing the ACL token to use in the request instead of one specified "+ + "via the -token argument or CONSUL_HTTP_TOKEN environment variable. "+ + "This can also be specified via the CONSUL_HTTP_TOKEN_FILE environment variable.") + fs.Var(&f.caFile, "ca-file", + "Path to a CA file to use for TLS when communicating with Consul. This "+ + "can also be specified via the CONSUL_CACERT environment variable.") + fs.Var(&f.caPath, "ca-path", + "Path to a directory of CA certificates to use for TLS when communicating "+ + "with Consul. This can also be specified via the CONSUL_CAPATH environment variable.") + fs.Var(&f.tlsServerName, "tls-server-name", + "The server name to use as the SNI host when connecting via TLS. This "+ + "can also be specified via the CONSUL_TLS_SERVER_NAME environment variable.") + return fs +} + +func (f *HTTPFlags) Addr() string { + return f.address.String() +} + +func (f *HTTPFlags) Token() string { + return f.token.String() +} + +func (f *HTTPFlags) SetToken(v string) error { + return f.token.Set(v) +} + +func (f *HTTPFlags) TokenFile() string { + return f.tokenFile.String() +} + +func (f *HTTPFlags) SetTokenFile(v string) error { + return f.tokenFile.Set(v) +} + +func (f *HTTPFlags) ReadTokenFile() (string, error) { + tokenFile := f.tokenFile.String() + if tokenFile == "" { + return "", nil + } + + data, err := ioutil.ReadFile(tokenFile) + if err != nil { + return "", err + } + + return strings.TrimSpace(string(data)), nil +} + +func (f *HTTPFlags) APIClient() (*api.Client, error) { + c := api.DefaultConfig() + + f.MergeOntoConfig(c) + + return api.NewClient(c) +} + +func (f *HTTPFlags) MergeOntoConfig(c *api.Config) { + f.address.Merge(&c.Address) + f.token.Merge(&c.Token) + f.tokenFile.Merge(&c.TokenFile) + f.caFile.Merge(&c.TLSConfig.CAFile) + f.caPath.Merge(&c.TLSConfig.CAPath) + f.tlsServerName.Merge(&c.TLSConfig.Address) +} + +func Merge(dst, src *flag.FlagSet) { + if dst == nil { + panic("dst cannot be nil") + } + if src == nil { + return + } + src.VisitAll(func(f *flag.Flag) { + dst.Var(f.Value, f.Name, f.Usage) + }) +} + +// StringValue provides a flag value that's aware if it has been set. +type StringValue struct { + v *string +} + +// Merge will overlay this value if it has been set. +func (s *StringValue) Merge(onto *string) { + if s.v != nil { + *onto = *(s.v) + } +} + +// Set implements the flag.Value interface. +func (s *StringValue) Set(v string) error { + if s.v == nil { + s.v = new(string) + } + *(s.v) = v + return nil +} + +// String implements the flag.Value interface. +func (s *StringValue) String() string { + var current string + if s.v != nil { + current = *(s.v) + } + return current +} diff --git a/subcommand/flags/k8s.go b/subcommand/flags/k8s.go index ee3d951180..31a2284f65 100644 --- a/subcommand/flags/k8s.go +++ b/subcommand/flags/k8s.go @@ -2,12 +2,10 @@ package flags import ( "flag" - - "github.com/hashicorp/consul/command/flags" ) type K8SFlags struct { - kubeconfig flags.StringValue + kubeconfig StringValue } func (f *K8SFlags) Flags() *flag.FlagSet { diff --git a/subcommand/flags/usage.go b/subcommand/flags/usage.go new file mode 100644 index 0000000000..f34adabac0 --- /dev/null +++ b/subcommand/flags/usage.go @@ -0,0 +1,117 @@ +package flags + +import ( + "bytes" + "flag" + "fmt" + "io" + "strings" + + text "github.com/kr/text" +) + +// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/usage.go +// This was done so we don't depend on internal Consul implementation. + +// Usage returns a usage string nicely formatted. +func Usage(txt string, flags *flag.FlagSet) string { + u := &Usager{ + Usage: txt, + Flags: flags, + } + return u.String() +} + +type Usager struct { + Usage string + Flags *flag.FlagSet +} + +func (u *Usager) String() string { + out := new(bytes.Buffer) + out.WriteString(strings.TrimSpace(u.Usage)) + out.WriteString("\n") + out.WriteString("\n") + + if u.Flags != nil { + f := &HTTPFlags{} + httpFlagSet := f.Flags() + + var httpFlags, cmdFlags *flag.FlagSet + u.Flags.VisitAll(func(f *flag.Flag) { + if contains(httpFlagSet, f) { + if httpFlags == nil { + httpFlags = flag.NewFlagSet("", flag.ContinueOnError) + } + httpFlags.Var(f.Value, f.Name, f.Usage) + } else { + if cmdFlags == nil { + cmdFlags = flag.NewFlagSet("", flag.ContinueOnError) + } + cmdFlags.Var(f.Value, f.Name, f.Usage) + } + }) + + if httpFlags != nil { + printTitle(out, "HTTP API Options") + httpFlags.VisitAll(func(f *flag.Flag) { + printFlag(out, f) + }) + } + + if cmdFlags != nil { + printTitle(out, "Command Options") + cmdFlags.VisitAll(func(f *flag.Flag) { + printFlag(out, f) + }) + } + } + + return strings.TrimRight(out.String(), "\n") +} + +// printTitle prints a consistently-formatted title to the given writer. +func printTitle(w io.Writer, s string) { + fmt.Fprintf(w, "%s\n\n", s) +} + +// printFlag prints a single flag to the given writer. +func printFlag(w io.Writer, f *flag.Flag) { + example, _ := flag.UnquoteUsage(f) + if example != "" { + fmt.Fprintf(w, " -%s=<%s>\n", f.Name, example) + } else { + fmt.Fprintf(w, " -%s\n", f.Name) + } + + indented := wrapAtLength(f.Usage, 5) + fmt.Fprintf(w, "%s\n\n", indented) +} + +// contains returns true if the given flag is contained in the given flag +// set or false otherwise. +func contains(fs *flag.FlagSet, f *flag.Flag) bool { + if fs == nil { + return false + } + + var in bool + fs.VisitAll(func(hf *flag.Flag) { + in = in || f.Name == hf.Name + }) + return in +} + +// maxLineLength is the maximum width of any line. +const maxLineLength int = 72 + +// wrapAtLength wraps the given text at the maxLineLength, taking into account +// any provided left padding. +func wrapAtLength(s string, pad int) string { + wrapped := text.Wrap(s, maxLineLength-pad) + lines := strings.Split(wrapped, "\n") + for i, line := range lines { + lines[i] = strings.Repeat(" ", pad) + line + } + return strings.Join(lines, "\n") +} diff --git a/subcommand/get-consul-client-ca/command.go b/subcommand/get-consul-client-ca/command.go index 4453f48a8e..2cea786540 100644 --- a/subcommand/get-consul-client-ca/command.go +++ b/subcommand/get-consul-client-ca/command.go @@ -11,8 +11,8 @@ import ( "github.com/cenkalti/backoff" godiscover "github.com/hashicorp/consul-k8s/helper/go-discover" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-discover" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" diff --git a/subcommand/inject-connect/command.go b/subcommand/inject-connect/command.go index b2621e1637..ed1b40f525 100644 --- a/subcommand/inject-connect/command.go +++ b/subcommand/inject-connect/command.go @@ -16,8 +16,8 @@ import ( "github.com/deckarep/golang-set" "github.com/hashicorp/consul-k8s/connect-inject" "github.com/hashicorp/consul-k8s/helper/cert" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" "k8s.io/apimachinery/pkg/api/resource" @@ -119,8 +119,7 @@ func (c *Command) init() { c.flagSet.StringVar(&c.flagDefaultSidecarProxyMemoryRequest, "default-sidecar-proxy-memory-request", "", "Default sidecar proxy memory request.") c.http = &flags.HTTPFlags{} - flags.Merge(c.flagSet, c.http.ClientFlags()) - flags.Merge(c.flagSet, c.http.ServerFlags()) + flags.Merge(c.flagSet, c.http.Flags()) c.help = flags.Usage(help, c.flagSet) } diff --git a/subcommand/lifecycle-sidecar/command.go b/subcommand/lifecycle-sidecar/command.go index b6b44e67f1..3a6747868a 100644 --- a/subcommand/lifecycle-sidecar/command.go +++ b/subcommand/lifecycle-sidecar/command.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/hashicorp/consul/command/flags" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" "github.com/prometheus/common/log" @@ -45,7 +45,7 @@ func (c *Command) init() { c.help = flags.Usage(help, c.flagSet) c.http = &flags.HTTPFlags{} - flags.Merge(c.flagSet, c.http.ClientFlags()) + flags.Merge(c.flagSet, c.http.Flags()) c.help = flags.Usage(help, c.flagSet) // Wait on an interrupt to exit. This channel must be initialized before @@ -154,7 +154,7 @@ func (c *Command) validateFlags() error { // from command's HTTP flags and returns them as an array of strings. func (c *Command) parseConsulFlags() []string { var consulCommandFlags []string - c.http.ClientFlags().VisitAll(func(f *flag.Flag) { + c.http.Flags().VisitAll(func(f *flag.Flag) { if f.Value.String() != "" { consulCommandFlags = append(consulCommandFlags, fmt.Sprintf("-%s=%s", f.Name, f.Value.String())) } diff --git a/subcommand/lifecycle-sidecar/command_test.go b/subcommand/lifecycle-sidecar/command_test.go index 5e434847b5..1a7f2f966a 100644 --- a/subcommand/lifecycle-sidecar/command_test.go +++ b/subcommand/lifecycle-sidecar/command_test.go @@ -233,9 +233,6 @@ func TestRun_ConsulCommandFlags(t *testing.T) { "-token-file=/token/file", "-ca-file=/ca/file", "-ca-path=/ca/path", - "-client-cert=/client/cert", - "-client-key=/client/key", - "-tls-server-name=consul.foo.com", }) defer stopCommand(t, &cmd, exitChan) @@ -247,9 +244,6 @@ func TestRun_ConsulCommandFlags(t *testing.T) { "-token-file=/token/file", "-ca-file=/ca/file", "-ca-path=/ca/path", - "-client-cert=/client/cert", - "-client-key=/client/key", - "-tls-server-name=consul.foo.com", configFile, } timer := &retry.Timer{Timeout: 1000 * time.Millisecond, Wait: 100 * time.Millisecond} diff --git a/subcommand/server-acl-init/command.go b/subcommand/server-acl-init/command.go index e75e9f908f..4c3a73307d 100644 --- a/subcommand/server-acl-init/command.go +++ b/subcommand/server-acl-init/command.go @@ -14,9 +14,9 @@ import ( godiscover "github.com/hashicorp/consul-k8s/helper/go-discover" "github.com/hashicorp/consul-k8s/subcommand" "github.com/hashicorp/consul-k8s/subcommand/common" + "github.com/hashicorp/consul-k8s/subcommand/flags" k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-discover" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" diff --git a/subcommand/service-address/command.go b/subcommand/service-address/command.go index 8175e30c89..32ec3ba71f 100644 --- a/subcommand/service-address/command.go +++ b/subcommand/service-address/command.go @@ -12,8 +12,8 @@ import ( "github.com/cenkalti/backoff" "github.com/hashicorp/consul-k8s/subcommand" + "github.com/hashicorp/consul-k8s/subcommand/flags" k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" v1 "k8s.io/api/core/v1" diff --git a/subcommand/sync-catalog/command.go b/subcommand/sync-catalog/command.go index af844b7b53..3314dca1b5 100644 --- a/subcommand/sync-catalog/command.go +++ b/subcommand/sync-catalog/command.go @@ -15,9 +15,8 @@ import ( catalogtok8s "github.com/hashicorp/consul-k8s/catalog/to-k8s" "github.com/hashicorp/consul-k8s/helper/controller" "github.com/hashicorp/consul-k8s/subcommand" - k8sflags "github.com/hashicorp/consul-k8s/subcommand/flags" + "github.com/hashicorp/consul-k8s/subcommand/flags" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,7 +31,7 @@ type Command struct { flags *flag.FlagSet http *flags.HTTPFlags - k8s *k8sflags.K8SFlags + k8s *flags.K8SFlags flagListen string flagToConsul bool flagToK8S bool @@ -134,9 +133,8 @@ func (c *Command) init() { "discovery across Consul namespaces. Only necessary if ACLs are enabled.") c.http = &flags.HTTPFlags{} - c.k8s = &k8sflags.K8SFlags{} - flags.Merge(c.flags, c.http.ClientFlags()) - flags.Merge(c.flags, c.http.ServerFlags()) + c.k8s = &flags.K8SFlags{} + flags.Merge(c.flags, c.http.Flags()) flags.Merge(c.flags, c.k8s.Flags()) c.help = flags.Usage(help, c.flags) From 3c87e52e365f7570f17afb07bec76239392670fd Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:43:07 -0700 Subject: [PATCH 2/2] Code review feedback --- go.mod | 14 ++- go.sum | 129 ---------------------- subcommand/flags/flag_duration_value.go | 64 ----------- subcommand/flags/flag_map_value.go | 40 ------- subcommand/flags/flag_map_value_test.go | 83 -------------- subcommand/flags/flag_slice_value.go | 2 +- subcommand/flags/flag_slice_value_test.go | 2 +- subcommand/flags/http.go | 12 +- subcommand/flags/http_test.go | 18 +++ subcommand/flags/usage.go | 4 +- subcommand/flags/usage_test.go | 75 +++++++++++++ subcommand/sync-catalog/command.go | 12 +- 12 files changed, 125 insertions(+), 330 deletions(-) delete mode 100644 subcommand/flags/flag_duration_value.go delete mode 100644 subcommand/flags/flag_map_value.go delete mode 100644 subcommand/flags/flag_map_value_test.go create mode 100644 subcommand/flags/http_test.go create mode 100644 subcommand/flags/usage_test.go diff --git a/go.mod b/go.mod index e7ae78f33b..8a20305d02 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,35 @@ module github.com/hashicorp/consul-k8s require ( + github.com/Azure/go-autorest v10.15.3+incompatible // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect + github.com/armon/go-radix v1.0.0 // indirect github.com/cenkalti/backoff v2.1.1+incompatible github.com/deckarep/golang-set v1.7.1 + github.com/digitalocean/godo v1.10.0 // indirect github.com/gogo/protobuf v1.3.1 // indirect github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect github.com/googleapis/gnostic v0.3.1 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/hashicorp/consul v1.7.1 github.com/hashicorp/consul/api v1.4.0 github.com/hashicorp/consul/sdk v0.4.0 github.com/hashicorp/go-discover v0.0.0-20191202160150-7ec2cfbda7a2 github.com/hashicorp/go-hclog v0.12.0 + github.com/hashicorp/go-immutable-radix v1.1.0 // indirect + github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.0.0 + github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/hashicorp/mdns v1.0.1 // indirect + github.com/hashicorp/memberlist v0.1.6 // indirect + github.com/hashicorp/serf v0.8.5 // indirect github.com/imdario/mergo v0.3.8 // indirect github.com/json-iterator/go v1.1.8 // indirect github.com/kr/text v0.1.0 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a + github.com/miekg/dns v1.1.26 // indirect github.com/mitchellh/cli v1.0.0 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.1.2 @@ -28,7 +38,9 @@ require ( github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 github.com/radovskyb/watcher v1.0.2 github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.4.0 + golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 // indirect golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect diff --git a/go.sum b/go.sum index c92012c7b5..b9e20e4ec0 100644 --- a/go.sum +++ b/go.sum @@ -7,13 +7,8 @@ github.com/Azure/go-autorest v10.7.0+incompatible h1:dB+dKSLGdJLEhU/FoZTSNSPMZuE github.com/Azure/go-autorest v10.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v10.15.3+incompatible h1:nhKI/bvazIs3C3TFGoSqKY6hZ8f5od5mb5/UcS6HVIY= github.com/Azure/go-autorest v10.15.3+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v2.2.0+incompatible h1:V5BKkxACZLjzHjSgBbr2gvLA2Ae49yhc6CSY7MLy5k4= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Microsoft/go-winio v0.4.3/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/NYTimes/gziphandler v1.0.1 h1:iLrQrdwjDd52kHDA5op2UBJFjmOb9g+7scBan4RN8F0= -github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= @@ -34,16 +29,12 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLM github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -60,48 +51,27 @@ github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TR github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/envoyproxy/go-control-plane v0.8.0 h1:uE6Fp4fOcAJdc1wTQXLJ+SYistkbG1dNoi6Zs1+Ybvk= -github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= -github.com/envoyproxy/protoc-gen-validate v0.0.14 h1:YBW6/cKy9prEGRYLnaGa4IDhzxZhRCtKsax8srGKDnM= -github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+AfE52mFHOXVFnOSBJBRlzTHrOPLOIhE= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -116,49 +86,29 @@ github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORR github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/hashicorp/consul v1.7.1 h1:HgnJOJWGc8PIqRYa5VKT3KXB5fqYqloX/u5Bk1bY3/8= -github.com/hashicorp/consul v1.7.1/go.mod h1:vKfXmSQNl6HwO/JqQ2DDLzisBDV49y+JVTkrdW1cnSU= github.com/hashicorp/consul/api v1.4.0 h1:jfESivXnO5uLdH650JU/6AnjRoHrLhULq0FnC3Kp9EY= github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/sdk v0.4.0 h1:zBtCfKJZcJDBvSCkQJch4ulp59m1rATFLKwNo/LYY30= github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.2 h1:ijMXI4qERbzxbCnkxmfUtwMyjrrk3y+Vt0MxojNCbBs= -github.com/hashicorp/go-bexpr v0.1.2/go.mod h1:ANbpTX1oAql27TZkKVeW8p1w8NTdnyzPe/0qqPCKohU= -github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= -github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-connlimit v0.2.0 h1:OZjcfNxH/hPh/bT2Iw5yOJcLzz+zuIWpsp3I1S4Pjw4= -github.com/hashicorp/go-connlimit v0.2.0/go.mod h1:OUj9FGL1tPIhl/2RCfzYHrIiWj+VVPGNyVPnUX8AqS0= github.com/hashicorp/go-discover v0.0.0-20191202160150-7ec2cfbda7a2 h1:r7GtRT+VXoM5WqHMxSVDIKgVCfK9T8CoS51RDKeOjBM= github.com/hashicorp/go-discover v0.0.0-20191202160150-7ec2cfbda7a2/go.mod h1:NnH5X4UCBEBdTuK2L8s4e4ilJm3UmGX0bANHCz0HSs0= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0 h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-memdb v1.0.3 h1:iiqzNk8jKB6/sLRj623Ui/Vi1zf21LOUpgzGjTge6a8= -github.com/hashicorp/go-memdb v1.0.3/go.mod h1:LWQ8R70vPrS4OEY9k28D2z8/Zzyu34NVzeRibGAzHO0= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-raftchunking v0.6.1 h1:moEnaG3gcwsWNyIBJoD5PCByE+Ewkqxh6N05CT+MbwA= -github.com/hashicorp/go-raftchunking v0.6.1/go.mod h1:cGlg3JtDy7qy6c/3Bu660Mic1JF+7lWqIwCFSb08fX0= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -169,16 +119,10 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hil v0.0.0-20160711231837-1e86c6b523c5/go.mod h1:KHvg/R2/dPtaePb16oW4qIyzkMxXOL38xjRN64adsts= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -187,26 +131,11 @@ github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.1.6 h1:ouPxvwKYaNZe+eTcHxYP0EblPduVLvIPycul+vv8his= github.com/hashicorp/memberlist v0.1.6/go.mod h1:5VDNHjqFMgEcclnwmkCnC99IPwxBmIsxwY8qn+Nl0H4= -github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 h1:lc3c72qGlIMDqQpQH82Y4vaglRMMFdJbziYWriR4UcE= -github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q= -github.com/hashicorp/raft v1.1.1 h1:HJr7UE1x/JrJSc9Oy6aDBHtNHUUBHjcQjTgvUVihoZs= -github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft v1.1.2 h1:oxEL5DDeurYxLd3UbcY/hccgSPhLLpiBZ1YxtWEq59c= -github.com/hashicorp/raft v1.1.2/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4= -github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.8.5 h1:ZynDUIQiA8usmRgPdGPHFdPnb1wgGI9tK3mO9hcAJjc= github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= -github.com/hashicorp/vault/api v1.0.4 h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13 h1:mOEPeOhT7jl0J4AMl1E705+BcmeRs1VmKNb9F0sMLy8= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 h1:O/pT5C1Q3mVXMyuqg7yuAWUg/jMZR1/0QTzTRdNR6Uw= github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443/go.mod h1:bEpDU35nTu0ey1EXjwNwPjI9xErAsoOCmcMb9GKvyxo= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -222,10 +151,8 @@ github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -261,24 +188,17 @@ github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -287,12 +207,10 @@ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c h1:vwpFWvAO8DeIZfFeqASzZfsxuWPno9ncAebBEP0N3uE= @@ -302,8 +220,6 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -326,13 +242,8 @@ github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03/go.mod h1:gRAiPF5C5N github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/sirupsen/logrus v1.0.6 h1:hcP1GmhGigz/O7h1WVUM5KklBp1JoNS9FggWKdj/j3s= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -340,7 +251,6 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d/go.mod h1:Cw4GTlQccdRGSEf6KiMju767x0NEHE0YIVPJSaXjlsw= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -362,46 +272,31 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 h1:PDpCLFAH/YIX0QpHPf2eO7L4rC2OOirBrKtXTLLiNTY= golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -410,20 +305,13 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180829000535-087779f1d2c9 h1:z1TeLUmxf9ws9KLICfmX+KGXTs+rjm+aGWzfsv7MZ9w= @@ -431,21 +319,10 @@ google.golang.org/api v0.0.0-20180829000535-087779f1d2c9/go.mod h1:4mhQ8q/RsB7i+ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= @@ -458,8 +335,6 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -467,16 +342,12 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -istio.io/gogo-genproto v0.0.0-20190124151557-6d926a6e6feb/go.mod h1:eIDJ6jNk/IeJz6ODSksHl5Aiczy5JUq6vFhJWI5OtiI= k8s.io/api v0.0.0-20180806132203-61b11ee65332/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190325185214-7544f9db76f6 h1:9MWtbqhwTyDvF4cS1qAhxDb9Mi8taXiAu+5nEacl7gY= k8s.io/api v0.0.0-20190325185214-7544f9db76f6/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apimachinery v0.0.0-20180821005732-488889b0007f/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190223001710-c182ff3b9841 h1:Q4RZrHNtlC/mSdC1sTrcZ5RchC/9vxLVj57pWiCBKv4= k8s.io/apimachinery v0.0.0-20190223001710-c182ff3b9841/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190620073744-d16981aedf33 h1:Lkd+QNFOB3DqrDyWo796aodJgFJautn/M+t9IGearPc= k8s.io/client-go v8.0.0+incompatible h1:tTI4hRmb1DRMl4fG6Vclfdi6nTM82oIrTT7HfitmxC4= k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c h1:3KSCztE7gPitlZmWbNwue/2U0YruD65DqX3INopDAQM= diff --git a/subcommand/flags/flag_duration_value.go b/subcommand/flags/flag_duration_value.go deleted file mode 100644 index dd3dff27b0..0000000000 --- a/subcommand/flags/flag_duration_value.go +++ /dev/null @@ -1,64 +0,0 @@ -package flags - -import ( - "reflect" - "time" - - "github.com/mitchellh/mapstructure" -) - -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_duration_value.go -// This was done so we don't depend on internal Consul implementation. - -// DurationValue provides a flag value that's aware if it has been set. -type DurationValue struct { - v *time.Duration -} - -// Merge will overlay this value if it has been set. -func (d *DurationValue) Merge(onto *time.Duration) { - if d.v != nil { - *onto = *(d.v) - } -} - -// Set implements the flag.Value interface. -func (d *DurationValue) Set(v string) error { - if d.v == nil { - d.v = new(time.Duration) - } - var err error - *(d.v), err = time.ParseDuration(v) - return err -} - -// String implements the flag.Value interface. -func (d *DurationValue) String() string { - var current time.Duration - if d.v != nil { - current = *(d.v) - } - return current.String() -} - -// StringToDurationValueFunc is a mapstructure hook that looks for an incoming -// string mapped to a DurationValue and does the translation. -func StringToDurationValueFunc() mapstructure.DecodeHookFunc { - return func( - f reflect.Type, - t reflect.Type, - data interface{}) (interface{}, error) { - if f.Kind() != reflect.String { - return data, nil - } - - val := DurationValue{} - if t != reflect.TypeOf(val) { - return data, nil - } - if err := val.Set(data.(string)); err != nil { - return nil, err - } - return val, nil - } -} diff --git a/subcommand/flags/flag_map_value.go b/subcommand/flags/flag_map_value.go deleted file mode 100644 index 26741abce8..0000000000 --- a/subcommand/flags/flag_map_value.go +++ /dev/null @@ -1,40 +0,0 @@ -package flags - -import ( - "flag" - "fmt" - "strings" -) - -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_map_value.go -// This was done so we don't depend on internal Consul implementation. - -// Ensure implements -var _ flag.Value = (*FlagMapValue)(nil) - -// FlagMapValue is a flag implementation used to provide key=value semantics -// multiple times. -type FlagMapValue map[string]string - -func (h *FlagMapValue) String() string { - return fmt.Sprintf("%v", *h) -} - -func (h *FlagMapValue) Set(value string) error { - idx := strings.Index(value, "=") - if idx == -1 { - return fmt.Errorf("Missing \"=\" value in argument: %s", value) - } - - key, value := value[0:idx], value[idx+1:] - - if *h == nil { - *h = make(map[string]string) - } - - headers := *h - headers[key] = value - *h = headers - - return nil -} diff --git a/subcommand/flags/flag_map_value_test.go b/subcommand/flags/flag_map_value_test.go deleted file mode 100644 index 9871bef511..0000000000 --- a/subcommand/flags/flag_map_value_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package flags - -import ( - "fmt" - "testing" -) - -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_map_value_test.go -// This was done so we don't depend on internal Consul implementation. - -func TestFlagMapValueSet(t *testing.T) { - t.Parallel() - - t.Run("missing =", func(t *testing.T) { - - f := new(FlagMapValue) - if err := f.Set("foo"); err == nil { - t.Fatal("expected error, got nil") - } - }) - - t.Run("sets", func(t *testing.T) { - - f := new(FlagMapValue) - if err := f.Set("foo=bar"); err != nil { - t.Fatal(err) - } - - r, ok := (*f)["foo"] - if !ok { - t.Errorf("missing value: %#v", f) - } - if exp := "bar"; r != exp { - t.Errorf("expected %q to be %q", r, exp) - } - }) - - t.Run("sets multiple", func(t *testing.T) { - - f := new(FlagMapValue) - - r := map[string]string{ - "foo": "bar", - "zip": "zap", - "cat": "dog", - } - - for k, v := range r { - if err := f.Set(fmt.Sprintf("%s=%s", k, v)); err != nil { - t.Fatal(err) - } - } - - for k, v := range r { - r, ok := (*f)[k] - if !ok { - t.Errorf("missing value %q: %#v", k, f) - } - if exp := v; r != exp { - t.Errorf("expected %q to be %q", r, exp) - } - } - }) - - t.Run("overwrites", func(t *testing.T) { - - f := new(FlagMapValue) - if err := f.Set("foo=bar"); err != nil { - t.Fatal(err) - } - if err := f.Set("foo=zip"); err != nil { - t.Fatal(err) - } - - r, ok := (*f)["foo"] - if !ok { - t.Errorf("missing value: %#v", f) - } - if exp := "zip"; r != exp { - t.Errorf("expected %q to be %q", r, exp) - } - }) -} diff --git a/subcommand/flags/flag_slice_value.go b/subcommand/flags/flag_slice_value.go index 880297671c..11e838e683 100644 --- a/subcommand/flags/flag_slice_value.go +++ b/subcommand/flags/flag_slice_value.go @@ -2,7 +2,7 @@ package flags import "strings" -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_slice_value.go +// Taken from https://github.com/hashicorp/consul/blob/b5b9c8d953cd3c79c6b795946839f4cf5012f507/command/flags/flag_slice_value.go // This was done so we don't depend on internal Consul implementation. // AppendSliceValue implements the flag.Value interface and allows multiple diff --git a/subcommand/flags/flag_slice_value_test.go b/subcommand/flags/flag_slice_value_test.go index 58c05c8303..205d1a8180 100644 --- a/subcommand/flags/flag_slice_value_test.go +++ b/subcommand/flags/flag_slice_value_test.go @@ -6,7 +6,7 @@ import ( "testing" ) -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/flag_slice_value_test.go +// Taken from https://github.com/hashicorp/consul/blob/b5b9c8d953cd3c79c6b795946839f4cf5012f507/command/flags/flag_slice_value_test.go // This was done so we don't depend on internal Consul implementation. func TestAppendSliceValue_implements(t *testing.T) { diff --git a/subcommand/flags/http.go b/subcommand/flags/http.go index e48c699032..536c579d85 100644 --- a/subcommand/flags/http.go +++ b/subcommand/flags/http.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/consul/api" ) -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/http.go +// Taken from https://github.com/hashicorp/consul/blob/b5b9c8d953cd3c79c6b795946839f4cf5012f507/command/flags/http.go // with flags we don't use removed. This was done so we don't depend on internal // Consul implementation. @@ -19,6 +19,8 @@ type HTTPFlags struct { tokenFile StringValue caFile StringValue caPath StringValue + certFile StringValue + keyFile StringValue tlsServerName StringValue } @@ -44,6 +46,12 @@ func (f *HTTPFlags) Flags() *flag.FlagSet { fs.Var(&f.caPath, "ca-path", "Path to a directory of CA certificates to use for TLS when communicating "+ "with Consul. This can also be specified via the CONSUL_CAPATH environment variable.") + fs.Var(&f.certFile, "client-cert", + "Path to a client cert file to use for TLS when 'verify_incoming' is enabled. This "+ + "can also be specified via the CONSUL_CLIENT_CERT environment variable.") + fs.Var(&f.keyFile, "client-key", + "Path to a client key file to use for TLS when 'verify_incoming' is enabled. This "+ + "can also be specified via the CONSUL_CLIENT_KEY environment variable.") fs.Var(&f.tlsServerName, "tls-server-name", "The server name to use as the SNI host when connecting via TLS. This "+ "can also be specified via the CONSUL_TLS_SERVER_NAME environment variable.") @@ -98,6 +106,8 @@ func (f *HTTPFlags) MergeOntoConfig(c *api.Config) { f.tokenFile.Merge(&c.TokenFile) f.caFile.Merge(&c.TLSConfig.CAFile) f.caPath.Merge(&c.TLSConfig.CAPath) + f.certFile.Merge(&c.TLSConfig.CertFile) + f.keyFile.Merge(&c.TLSConfig.KeyFile) f.tlsServerName.Merge(&c.TLSConfig.Address) } diff --git a/subcommand/flags/http_test.go b/subcommand/flags/http_test.go new file mode 100644 index 0000000000..a44f79931c --- /dev/null +++ b/subcommand/flags/http_test.go @@ -0,0 +1,18 @@ +package flags + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// Taken from https://github.com/hashicorp/consul/blob/b5b9c8d953cd3c79c6b795946839f4cf5012f507/command/flags/http_test.go +// This was done so we don't depend on internal Consul implementation. + +func TestHTTPFlagsSetToken(t *testing.T) { + var f HTTPFlags + require := require.New(t) + require.Empty(f.Token()) + require.NoError(f.SetToken("foo")) + require.Equal("foo", f.Token()) +} diff --git a/subcommand/flags/usage.go b/subcommand/flags/usage.go index f34adabac0..960ce85926 100644 --- a/subcommand/flags/usage.go +++ b/subcommand/flags/usage.go @@ -7,10 +7,10 @@ import ( "io" "strings" - text "github.com/kr/text" + "github.com/kr/text" ) -// Taken from https://github.com/hashicorp/consul/blob/master/command/flags/usage.go +// Taken from https://github.com/hashicorp/consul/blob/b5b9c8d953cd3c79c6b795946839f4cf5012f507/command/flags/usage.go // This was done so we don't depend on internal Consul implementation. // Usage returns a usage string nicely formatted. diff --git a/subcommand/flags/usage_test.go b/subcommand/flags/usage_test.go new file mode 100644 index 0000000000..0b9c4793c9 --- /dev/null +++ b/subcommand/flags/usage_test.go @@ -0,0 +1,75 @@ +package flags + +import ( + "flag" + "strings" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestUsage(t *testing.T) { + flags := flag.NewFlagSet("", flag.ContinueOnError) + flags.String("flag1", "", "flag1 usage") + http := &HTTPFlags{} + Merge(flags, http.Flags()) + help := "Main help output" + + exp := `Main help output + +HTTP API Options + + -ca-file= + Path to a CA file to use for TLS when communicating with Consul. + This can also be specified via the CONSUL_CACERT environment + variable. + + -ca-path= + Path to a directory of CA certificates to use for TLS when + communicating with Consul. This can also be specified via the + CONSUL_CAPATH environment variable. + + -client-cert= + Path to a client cert file to use for TLS when 'verify_incoming' + is enabled. This can also be specified via the CONSUL_CLIENT_CERT + environment variable. + + -client-key= + Path to a client key file to use for TLS when 'verify_incoming' + is enabled. This can also be specified via the CONSUL_CLIENT_KEY + environment variable. + + -http-addr=
+ The $address$ and port of the Consul HTTP agent. The value can be + an IP address or DNS address, but it must also include the port. + This can also be specified via the CONSUL_HTTP_ADDR environment + variable. The default value is http://127.0.0.1:8500. The scheme + can also be set to HTTPS by setting the environment variable + CONSUL_HTTP_SSL=true. + + -tls-server-name= + The server name to use as the SNI host when connecting via + TLS. This can also be specified via the CONSUL_TLS_SERVER_NAME + environment variable. + + -token= + ACL token to use in the request. This can also be specified via the + CONSUL_HTTP_TOKEN environment variable. If unspecified, the query + will default to the token of the Consul agent at the HTTP address. + + -token-file= + File containing the ACL token to use in the request instead of one + specified via the -token argument or CONSUL_HTTP_TOKEN environment + variable. This can also be specified via the CONSUL_HTTP_TOKEN_FILE + environment variable. + +Command Options + + -flag1= + flag1 usage` + + // Had to use $ instead of backticks above for multiline string. + // Here we sub the backtick back in. + exp = strings.Replace(exp, "$", "`", -1) + require.Equal(t, exp, Usage(help, flags)) +} diff --git a/subcommand/sync-catalog/command.go b/subcommand/sync-catalog/command.go index 3314dca1b5..cc49e2727b 100644 --- a/subcommand/sync-catalog/command.go +++ b/subcommand/sync-catalog/command.go @@ -42,7 +42,7 @@ type Command struct { flagConsulServicePrefix string flagK8SSourceNamespace string flagK8SWriteNamespace string - flagConsulWritePeriod flags.DurationValue + flagConsulWritePeriod time.Duration flagSyncClusterIPServices bool flagSyncLBEndpoints bool flagNodePortSyncType string @@ -95,7 +95,7 @@ func (c *Command) init() { "Kubernetes. Defaults to consul.") c.flags.StringVar(&c.flagConsulK8STag, "consul-k8s-tag", "k8s", "Tag value for K8S services registered in Consul") - c.flags.Var(&c.flagConsulWritePeriod, "consul-write-interval", + c.flags.DurationVar(&c.flagConsulWritePeriod, "consul-write-interval", 30*time.Second, "The interval to perform syncing operations creating Consul services, formatted "+ "as a time.Duration. All changes are merged and write calls are only made "+ "on this interval. Defaults to 30 seconds (30s).") @@ -196,10 +196,6 @@ func (c *Command) Run(args []string) int { }) } - // Get the sync interval - var syncInterval time.Duration - c.flagConsulWritePeriod.Merge(&syncInterval) - // Convert allow/deny lists to sets allowSet := mapset.NewSet() denySet := mapset.NewSet() @@ -244,8 +240,8 @@ func (c *Command) Run(args []string) int { Log: c.logger.Named("to-consul/sink"), EnableNamespaces: c.flagEnableNamespaces, CrossNamespaceACLPolicy: c.flagCrossNamespaceACLPolicy, - SyncPeriod: syncInterval, - ServicePollPeriod: syncInterval * 2, + SyncPeriod: c.flagConsulWritePeriod, + ServicePollPeriod: c.flagConsulWritePeriod * 2, ConsulK8STag: c.flagConsulK8STag, ConsulNodeServicesClient: svcsClient, }