log error and ensure we pass through namespace

This commit is contained in:
Asim Aslam 2020-04-23 17:14:30 +01:00
parent 2299559397
commit ec929b3d2f
2 changed files with 4 additions and 4 deletions

View File

@ -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
}

View File

@ -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