diff --git a/config/provider/inmem.go b/config/provider/inmem.go index 753c0064..0c56f7b5 100644 --- a/config/provider/inmem.go +++ b/config/provider/inmem.go @@ -18,6 +18,7 @@ import ( "sync" "github.com/layer5io/meshkit/config" + "github.com/layer5io/meshkit/encoding" "github.com/layer5io/meshkit/utils" ) @@ -54,7 +55,7 @@ func (l *InMem) GetKey(key string) string { func (l *InMem) GetObject(key string, result interface{}) error { l.mutex.Lock() defer l.mutex.Unlock() - return utils.Unmarshal(l.store[key], result) + return encoding.Unmarshal([]byte(l.store[key]), result) } // SetObject sets an object value for the key diff --git a/utils/kubernetes/crd.go b/utils/kubernetes/crd.go index b42cfbc9..0525a624 100644 --- a/utils/kubernetes/crd.go +++ b/utils/kubernetes/crd.go @@ -3,7 +3,7 @@ package kubernetes import ( "context" - "github.com/layer5io/meshkit/utils" + "github.com/layer5io/meshkit/encoding" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/rest" ) @@ -35,7 +35,7 @@ func GetAllCustomResourcesInCluster(ctx context.Context, client rest.Interface) } var xcrd CRD gvks := []*schema.GroupVersionResource{} - err = utils.Unmarshal(string(crdresult), &xcrd) + err = encoding.Unmarshal(crdresult, &xcrd) if err != nil { return nil, err }