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

Conversation

ShivanshuGupta07
Copy link

Description

This PR fixes #575 by replacing deprecated utils.Unmarshal with json.Unmarshal and removing unused variables from the codebase.

Notes for Reviewers

  • The changes involve updates to two specific files: config/provider/inmem.go and utils/kubernetes/crd.go.
  • Please verify that the replacement of utils.Unmarshal does not impact any other parts of the code that may rely on its specific behavior.

Signed commits

  • Yes, I signed my commits.

Copy link

welcome bot commented Aug 25, 2024

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.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

@leecalcote
Copy link
Member

Thank you, @ShivanshuGupta07!

@leecalcote leecalcote added kind/chore Necessary task language/go Golang related labels Sep 17, 2024
@MUzairS15
Copy link

@ShivanshuGupta07 merge conflicts

Copy link

@lekaf974 lekaf974 left a 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

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

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

Copy link

@MUzairS15 MUzairS15 left a 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)

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)

Choose a reason for hiding this comment

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

same here

@ShivanshuGupta07
Copy link
Author

ShivanshuGupta07 commented Sep 27, 2024

@MUzairS15, so no changes are required now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/chore Necessary task language/go Golang related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Golang Lint Check Warnings
4 participants