Merge branch 'master' into auth-has-role
This commit is contained in:
commit
d90cc8bf2f
@ -9,6 +9,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
"github.com/micro/go-micro/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Request is used to construct a http request for the k8s API.
|
// 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)
|
res, err := r.client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &Response{
|
return &Response{
|
||||||
|
@ -63,7 +63,7 @@ func (s *service) genSrv() *registry.Service {
|
|||||||
// if it exists then use it, otherwise
|
// if it exists then use it, otherwise
|
||||||
// use the address
|
// use the address
|
||||||
if len(s.opts.Advertise) > 0 {
|
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 {
|
if err != nil {
|
||||||
logger.Fatal(err)
|
logger.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ func TestOptions(t *testing.T) {
|
|||||||
id = "service-id"
|
id = "service-id"
|
||||||
version = "service-version"
|
version = "service-version"
|
||||||
address = "service-addr:8080"
|
address = "service-addr:8080"
|
||||||
advertise = "service-adv"
|
advertise = "service-adv:8080"
|
||||||
reg = memory.NewRegistry()
|
reg = memory.NewRegistry()
|
||||||
registerTTL = 123 * time.Second
|
registerTTL = 123 * time.Second
|
||||||
registerInterval = 456 * time.Second
|
registerInterval = 456 * time.Second
|
||||||
|
Loading…
Reference in New Issue
Block a user