Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #575: Replaced deprecated utils.Unmarshal and removed unused variables #579

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/provider/inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package provider

import (
"sync"

"encoding/json"
"github.com/layer5io/meshkit/config"
"github.com/layer5io/meshkit/utils"
)
Expand Down Expand Up @@ -54,7 +54,8 @@ 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 utils.Unmarshal(l.store[key], result)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Con you remove this since it is no more used

return json.Unmarshal([]byte(l.store[key]), result)
}

// SetObject sets an object value for the key
Expand Down
5 changes: 3 additions & 2 deletions utils/kubernetes/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package kubernetes

import (
"context"
"encoding/json"

"github.com/layer5io/meshkit/utils"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/rest"
)
Expand Down Expand Up @@ -35,7 +35,8 @@ func GetAllCustomResourcesInCluster(ctx context.Context, client rest.Interface)
}
var xcrd CRD
gvks := []*schema.GroupVersionResource{}
err = utils.Unmarshal(string(crdresult), &xcrd)
//err = utils.Unmarshal(string(crdresult), &xcrd)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

err = json.Unmarshal(crdresult, &xcrd)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion validator/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

var (
ErrValidateCode = ""
schemaPath = "components.schemas"
cueschema cue.Value
mx sync.Mutex
isSchemaLoaded bool
Expand Down
Loading