-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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: 81134: fix unsafe json for ReleaseControllerRevision #104049
fix: 81134: fix unsafe json for ReleaseControllerRevision #104049
Conversation
Hi @manugupt1. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
7b3f09f
to
4a13ddf
Compare
/kind bug |
4a13ddf
to
a1b64e3
Compare
a1b64e3
to
94951ee
Compare
using a typed struct would be more conventional IMO and make any future refactorings easier |
94951ee
to
6a43e57
Compare
/assign @soltysh |
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.
One nit and then you're good to go.
1. Ensures that ReleaseControllerRevision returns a proper json by marshalling an object into bytes. Otherwise, it returns an error. 2. Also, refactors the code to commonize the merge type GenerateDeleteOwnerRefStrategicMergeBytes that returns a byte and is used across ReleasePod, ReleaseControllerRevison ReleaseReplicaSet.
57bda7e
to
518482c
Compare
/triage accepted |
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.
/lgtm
/approve
/priority backlog |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atiratree, manugupt1, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix: 81134: fix unsafe json for ReleaseControllerRevision
There is a reference of the same
kubernetes/pkg/controller/garbagecollector/patch.go
Lines 32 to 39 in 04a72d5
but I went with this style of change because I did not want to make a private part of the package public and chose anonymous struct instead. Please let me know if it looks okay or another change is reqd. Thanks
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes unsafe json construction in ReleaseControllerRevision
Which issue(s) this PR fixes:
#81134
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:```docs
Test
ok k8s.io/kubernetes/pkg/controller/history 0.257s