diff --git a/util/kubernetes/api/request.go b/util/kubernetes/api/request.go index 92bcbed6..75456c90 100644 --- a/util/kubernetes/api/request.go +++ b/util/kubernetes/api/request.go @@ -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{ diff --git a/web/service.go b/web/service.go index d8f01179..4ca54f88 100644 --- a/web/service.go +++ b/web/service.go @@ -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) } diff --git a/web/service_test.go b/web/service_test.go index 0d033038..ee7eba32 100644 --- a/web/service_test.go +++ b/web/service_test.go @@ -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