add plaintext object overrider
What type of PR is this?
What this PR does / why we need it: Add plaintextObjectOverrider to support modify a json or yaml field value.
For example:
apiVersion: v1
kind: ConfigMap
metadata:
name: myconfigmap
#...
data:
test.json: |
{"key": {"test": "value"}, {"key1": "value"}}
The plaintextObjectOverrider to update the value of key's test field to "value1"
apiVersion: policy.karmada.io/v1alpha1
kind: OverridePolicy
metadata:
name: example
spec:
#...
overrideRules:
- overriders:
plaintextObjectOverrider:
- path: /data/test.json
plaintext:
- path: /key/test
operator: replace
value: value1
Which issue(s) this PR fixes: Fixes #5330
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Introduced `PlaintextObjectOverrider` for overriding values in YAML or JSON plaintext objects.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign kevin-wangzefeng for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/assign
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 43.47826% with 26 lines in your changes missing coverage. Please review.
Project coverage is 29.43%. Comparing base (
d18afa1) to head (ef5d10f). Report is 10 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| pkg/util/overridemanager/overridemanager.go | 43.47% | 16 Missing and 10 partials :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5329 +/- ##
==========================================
+ Coverage 29.36% 29.43% +0.07%
==========================================
Files 632 632
Lines 43862 43881 +19
==========================================
+ Hits 12878 12918 +40
+ Misses 30050 30014 -36
- Partials 934 949 +15
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 29.43% <43.47%> (+0.07%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@chaunceyjiang PTAL
I think it's need to add a release-note for it.
I think it's need to add a release-note for it.
How to add a release note?
How to add a release note?
Update in here will be ok:
@chaunceyjiang PTAL
@liangyuanpeng @XiShanYongYe-Chang PTAL
Kindly ping @chaunceyjiang
Hi @Patrick0308 thanks for your contribution!
Can you post the results? And by the way, can you help me squash the commit?
/kind feature
Can you post the results? And by the way, can you help me squash the commit?
GitHub can automatically squash commits.
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests
Thanks for pointing out the documentation reference. The karmada repository is not currently set up that way. Sometimes it is necessary to keep multiple commits.
Hi @Patrick0308, @chaunceyjiang may be busy with kubeCon China 2024 in Hong Kong recently. I see that this feature change also involves the addition of APIs to the OP. Can you share this topic at the next community meeting?
Hi @Patrick0308, @chaunceyjiang may be busy with kubeCon China 2024 in Hong Kong recently. I see that this feature change also involves the addition of APIs to the OP. Can you share this topic at the next community meeting?
Sure, what should I prepare for this? Maybe demonstrate a demo?
Sure, what should I prepare for this? Maybe demonstrate a demo?
That would be best. I hope you can also describe the background of the requirement, similar to a user story.
Hi @Patrick0308 would you like to sign up for a community meeting topic? There is a community meeting in Chinese today. https://docs.google.com/document/d/1y6YLVC-v7cmVAdbjedoyR5WL0-q45DBRXTvz5_I7bkA/edit#heading=h.1inx4hjf6903
Hi @Patrick0308 would you like to sign up for a community meeting topic? There is a community meeting in Chinese today. https://docs.google.com/document/d/1y6YLVC-v7cmVAdbjedoyR5WL0-q45DBRXTvz5_I7bkA/edit#heading=h.1inx4hjf6903
Ok, I requested the doc edit access.
Ok, I requested the doc edit access.
When you add such the mail group, will automatically get the document editing rights:
I have added an agenda for you.
Close By #5591