log error and ensure we pass through namespace
This commit is contained in:
parent
2299559397
commit
ec929b3d2f
@ -461,7 +461,7 @@ func (k *kubernetes) Read(opts ...runtime.ReadOption) ([]*runtime.Service, error
|
||||
labels["micro"] = options.Type
|
||||
}
|
||||
|
||||
srvs, err := k.getService(labels)
|
||||
srvs, err := k.getService(labels, client.GetNamespace(options.Namespace))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
@ -50,9 +51,8 @@ func (r *Response) Into(data interface{}) error {
|
||||
|
||||
defer r.res.Body.Close()
|
||||
decoder := json.NewDecoder(r.res.Body)
|
||||
err := decoder.Decode(&data)
|
||||
if err != nil {
|
||||
return ErrDecode
|
||||
if err := decoder.Decode(&data); err != nil {
|
||||
return fmt.Errorf("%v: %v", ErrDecode, err)
|
||||
}
|
||||
|
||||
return r.err
|
||||
|
Loading…
Reference in New Issue
Block a user