-
Notifications
You must be signed in to change notification settings - Fork 96
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
base: master
Are you sure you want to change the base?
Conversation
…ed variables Signed-off-by: Shivanshu Gupta <[email protected]>
Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Community Welcome Guide and sure to join the community Slack. |
Thank you, @ShivanshuGupta07! |
@ShivanshuGupta07 merge conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix comments + lint error
config/provider/inmem.go
Outdated
@@ -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) |
There was a problem hiding this comment.
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
utils/kubernetes/crd.go
Outdated
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Signed-off-by: Shivanshu Gupta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR is obsolete.
@@ -35,7 +34,7 @@ func GetAllCustomResourcesInCluster(ctx context.Context, client rest.Interface) | |||
} | |||
var xcrd CRD | |||
gvks := []*schema.GroupVersionResource{} | |||
err = encoding.Unmarshal(crdresult, &xcrd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encoding.Unmarshal
is not deprecated, in fact recommended to be used.
It is the encoder recently added in Meshkit, which supports both json/yaml
.
@@ -55,7 +54,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 encoding.Unmarshal([]byte(l.store[key]), result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@MUzairS15, so no changes are required now? |
Description
This PR fixes #575 by replacing deprecated
utils.Unmarshal
withjson.Unmarshal
and removing unused variables from the codebase.Notes for Reviewers
config/provider/inmem.go
andutils/kubernetes/crd.go
.utils.Unmarshal
does not impact any other parts of the code that may rely on its specific behavior.Signed commits