From fea93a5b7a2a7470f6b15a9c9d1ec21e5a67a5e9 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Thu, 7 May 2020 11:35:56 +0100 Subject: [PATCH 1/2] Log k8s Requests --- util/kubernetes/api/request.go | 3 +++ 1 file changed, 3 insertions(+) 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{ From d61df6363b34b9535baa496ad430fa598a889650 Mon Sep 17 00:00:00 2001 From: gggwvg Date: Fri, 8 May 2020 17:31:03 +0800 Subject: [PATCH 2/2] web: fix advertise address (#1608) * web: fix advertise address * web: fix test Signed-off-by: Vasiliy Tolstov Co-authored-by: Asim Aslam Co-authored-by: Vasiliy Tolstov --- web/service.go | 2 +- web/service_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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