1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

Merge branch 'master' into auth-has-role

This commit is contained in:
ben-toogood 2020-05-11 11:36:06 +01:00 committed by GitHub
commit d90cc8bf2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,8 @@ import (
"io"
"net/http"
"net/url"
"github.com/micro/go-micro/v2/logger"
)
// Request is used to construct a http request for the k8s API.
@ -217,6 +219,7 @@ func (r *Request) Do() *Response {
}
}
logger.Debugf("[Kubernetes] %v %v", req.Method, req.URL.String())
res, err := r.client.Do(req)
if err != nil {
return &Response{

View File

@ -63,7 +63,7 @@ func (s *service) genSrv() *registry.Service {
// if it exists then use it, otherwise
// use the address
if len(s.opts.Advertise) > 0 {
host, port, err = net.SplitHostPort(s.opts.Address)
host, port, err = net.SplitHostPort(s.opts.Advertise)
if err != nil {
logger.Fatal(err)
}

View File

@ -164,7 +164,7 @@ func TestOptions(t *testing.T) {
id = "service-id"
version = "service-version"
address = "service-addr:8080"
advertise = "service-adv"
advertise = "service-adv:8080"
reg = memory.NewRegistry()
registerTTL = 123 * time.Second
registerInterval = 456 * time.Second