diff --git a/go.mod b/go.mod index d69191f278f1..6c902b66ab24 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/stretchr/testify v1.4.0 github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448 github.com/ugorji/go v1.1.7 // indirect - github.com/weaveworks/common v0.0.0-20190822150010-afb9996716e4 + github.com/weaveworks/common v0.0.0-20191103151037-0e7cefadc44f go.etcd.io/etcd v0.0.0-20190815204525-8f85f0dc2607 // indirect go.opencensus.io v0.22.1 // indirect go.uber.org/atomic v1.4.0 // indirect @@ -67,8 +67,6 @@ require ( k8s.io/klog v0.4.0 ) -replace github.com/weaveworks/common => github.com/sandlis/weaveworks-common v0.0.0-20190822064708-8fa0a1ca9d89 - replace github.com/hpcloud/tail => github.com/grafana/tail v0.0.0-20191024143944-0b54ddf21fe7 // Override reference that causes an error from Go proxy - see https://github.com/golang/go/issues/33558 diff --git a/go.sum b/go.sum index 24fa9a9f77e5..4288400f6fe4 100644 --- a/go.sum +++ b/go.sum @@ -525,8 +525,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75 h1:cA+Ubq9qEVIQhIWvP2kNuSZ2CmnfBJFSRq+kO1pu2cc= github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sandlis/weaveworks-common v0.0.0-20190822064708-8fa0a1ca9d89 h1:Dop0x86c8v6sOhFX8JPHP2TQ4NdvMgtwAnzOxmK06Ww= -github.com/sandlis/weaveworks-common v0.0.0-20190822064708-8fa0a1ca9d89/go.mod h1:Gpi+45Cxn+Urtspw4hzsAtdiXjxBVdt3lipoh4aa/AU= github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -587,6 +585,10 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/weaveworks/billing-client v0.0.0-20171006123215-be0d55e547b1/go.mod h1:7gGdEUJaCrSlWi/mjd68CZv0sfqektYPDcro9cE+M9k= +github.com/weaveworks/common v0.0.0-20190822150010-afb9996716e4 h1:O8BmyjqQoByXjAj6XaTfcxxqSIK6DYLmOSiYQPL9yJg= +github.com/weaveworks/common v0.0.0-20190822150010-afb9996716e4/go.mod h1:pSm+0KR57BG3pvGoJWFXJSAC7+sEPewcvdt5StevL3A= +github.com/weaveworks/common v0.0.0-20191103151037-0e7cefadc44f h1:i423tFVikRDF9fS/STNgbQEr2rqEoZq7rryVsm/GwGQ= +github.com/weaveworks/common v0.0.0-20191103151037-0e7cefadc44f/go.mod h1:pSm+0KR57BG3pvGoJWFXJSAC7+sEPewcvdt5StevL3A= github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M= github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= diff --git a/pkg/promtail/promtail_test.go b/pkg/promtail/promtail_test.go index 5fa0ffc19767..c117af245a17 100644 --- a/pkg/promtail/promtail_test.go +++ b/pkg/promtail/promtail_test.go @@ -537,9 +537,9 @@ func buildTestConfig(t *testing.T, positionsFileName string, logDirName string) flagext.RegisterFlags(&cfg) const hostname = "localhost" - cfg.ServerConfig.HTTPListenHost = hostname + cfg.ServerConfig.HTTPListenAddress = hostname cfg.ServerConfig.ExternalURL = hostname - cfg.ServerConfig.GRPCListenHost = hostname + cfg.ServerConfig.GRPCListenAddress = hostname cfg.ServerConfig.HTTPListenPort = httpTestPort // Override some of those defaults diff --git a/vendor/github.com/weaveworks/common/aws/config.go b/vendor/github.com/weaveworks/common/aws/config.go index 378905c24076..8937e749ef57 100644 --- a/vendor/github.com/weaveworks/common/aws/config.go +++ b/vendor/github.com/weaveworks/common/aws/config.go @@ -5,6 +5,7 @@ import ( "net" "net/http" "net/url" + "os" "strings" "time" @@ -45,7 +46,14 @@ func ConfigFromURL(awsURL *url.URL) (*aws.Config, error) { } if strings.Contains(awsURL.Host, ".") { - return config.WithEndpoint(fmt.Sprintf("http://%s", awsURL.Host)).WithRegion("dummy"), nil + region := os.Getenv("AWS_REGION") + if region == "" { + region = "dummy" + } + if awsURL.Scheme == "https" { + return config.WithEndpoint(fmt.Sprintf("https://%s", awsURL.Host)).WithRegion(region), nil + } + return config.WithEndpoint(fmt.Sprintf("http://%s", awsURL.Host)).WithRegion(region), nil } // Let AWS generate default endpoint based on region passed as a host in URL. diff --git a/vendor/github.com/weaveworks/common/server/server.go b/vendor/github.com/weaveworks/common/server/server.go index 8fb3b155f751..6612cd5fa668 100644 --- a/vendor/github.com/weaveworks/common/server/server.go +++ b/vendor/github.com/weaveworks/common/server/server.go @@ -27,11 +27,11 @@ import ( // Config for a Server type Config struct { - MetricsNamespace string `yaml:"-"` - HTTPListenHost string `yaml:"http_listen_host"` - HTTPListenPort int `yaml:"http_listen_port"` - GRPCListenHost string `yaml:"grpc_listen_host"` - GRPCListenPort int `yaml:"grpc_listen_port"` + MetricsNamespace string `yaml:"-"` + HTTPListenAddress string `yaml:"http_listen_address"` + HTTPListenPort int `yaml:"http_listen_port"` + GRPCListenAddress string `yaml:"grpc_listen_address"` + GRPCListenPort int `yaml:"grpc_listen_port"` RegisterInstrumentation bool `yaml:"register_instrumentation"` ExcludeRequestInLog bool `yaml:"-"` @@ -58,9 +58,9 @@ type Config struct { // RegisterFlags adds the flags required to config this to the given FlagSet func (cfg *Config) RegisterFlags(f *flag.FlagSet) { - f.StringVar(&cfg.HTTPListenHost, "server.http-listen-host", "", "HTTP server listen host.") + f.StringVar(&cfg.HTTPListenAddress, "server.http-listen-address", "", "HTTP server listen address.") f.IntVar(&cfg.HTTPListenPort, "server.http-listen-port", 80, "HTTP server listen port.") - f.StringVar(&cfg.GRPCListenHost, "server.grpc-listen-host", "", "gRPC server listen host.") + f.StringVar(&cfg.GRPCListenAddress, "server.grpc-listen-address", "", "gRPC server listen address.") f.IntVar(&cfg.GRPCListenPort, "server.grpc-listen-port", 9095, "gRPC server listen port.") f.BoolVar(&cfg.RegisterInstrumentation, "server.register-instrumentation", true, "Register the intrumentation handlers (/metrics etc).") f.DurationVar(&cfg.ServerGracefulShutdownTimeout, "server.graceful-shutdown-timeout", 30*time.Second, "Timeout for graceful shutdowns") @@ -92,12 +92,12 @@ type Server struct { // New makes a new Server func New(cfg Config) (*Server, error) { // Setup listeners first, so we can fail early if the port is in use. - httpListener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", cfg.HTTPListenHost, cfg.HTTPListenPort)) + httpListener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", cfg.HTTPListenAddress, cfg.HTTPListenPort)) if err != nil { return nil, err } - grpcListener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", cfg.GRPCListenHost, cfg.GRPCListenPort)) + grpcListener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", cfg.GRPCListenAddress, cfg.GRPCListenPort)) if err != nil { return nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 8cefd12c353d..9e537a988765 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -482,7 +482,7 @@ github.com/uber/jaeger-lib/metrics github.com/uber/jaeger-lib/metrics/prometheus # github.com/ugorji/go/codec v1.1.7 github.com/ugorji/go/codec -# github.com/weaveworks/common v0.0.0-20190822150010-afb9996716e4 => github.com/sandlis/weaveworks-common v0.0.0-20190822064708-8fa0a1ca9d89 +# github.com/weaveworks/common v0.0.0-20191103151037-0e7cefadc44f github.com/weaveworks/common/aws github.com/weaveworks/common/errors github.com/weaveworks/common/httpgrpc