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: direct []byte write when updating resources #607

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

nekomeowww
Copy link
Contributor

@nekomeowww nekomeowww commented Nov 28, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Currently it writes without the help of datatypes.JSON when updating field object:

	updatedResource := map[string]interface{}{
		"owner_uid":        ownerUID,
		"uid":              metaobj.GetUID(),
		"resource_version": metaobj.GetResourceVersion(),
		"object":           buffer.Bytes(),
	}

which will cause the object field to be hex (binary) format when querying with database tools as following:

image
  1. wrapped datatypes.JSON when updating object

Which issue(s) this PR fixes

None.

Special notes for your reviewer

Does this PR introduce a user-facing change?:

NONE

@clusterpedia-bot
Copy link

Hi @nekomeowww,
Thanks for your pull request!
If the PR is ready, use the /auto-cc command to assign Reviewer to Review.
We will review it shortly.

Details

Instructions for interacting with me using comments are available here.
If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

@clusterpedia-bot clusterpedia-bot added the kind/bug Something isn't working label Nov 28, 2023
@nekomeowww nekomeowww changed the title fix: direct []byte write when updating resources fix: direct []byte write when updating resources Nov 28, 2023
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Copy link
Member

@Iceber Iceber left a comment

Choose a reason for hiding this comment

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

LGTM

@Iceber Iceber merged commit b725360 into clusterpedia-io:main Nov 28, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants