-
Notifications
You must be signed in to change notification settings - Fork 301
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
feat: support merging user and default bootstrap configurations #1791
Conversation
ca569bc
to
bf4cea9
Compare
Codecov Report
@@ Coverage Diff @@
## main #1791 +/- ##
==========================================
- Coverage 65.15% 65.07% -0.08%
==========================================
Files 84 86 +2
Lines 12230 12281 +51
==========================================
+ Hits 7968 7992 +24
- Misses 3754 3775 +21
- Partials 508 514 +6
|
thanks for picking this up @zhaohuabing, can you split up API and implementation into 2 PRs, which may help with faster reviews, thanks ! |
@arkodg Since this is a breaking change, it won't pass the build if just changing the API. |
ah yah, sure lets stick with this for now |
708f1f0
to
18a5e3e
Compare
@arkodg Should I add a notice in the release note so that users won't be surprised by this breaking change? If yes, do you know where to add this note? |
added the release note label, hopefully this reminds the release manager to add this note, we can work on proactively adding release notes too, maybe in the PR description that the release manager can copy into the release notes |
// MergeYAML merges two yaml files. The second yaml file will override the first one if the same key exists. | ||
// This method can add or override a value within a map, or add a new value to a list. | ||
// Please note that this method can't override a value within a list. | ||
func MergeYAML(base, override string) (string, error) { |
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.
can we use https://github.com/evanphx/json-patch instead, i.e. convert the YAMLs into JSON using sigs.k8s.io/yaml
and then use jsonpatch.MergePatch
and convert it back to YAML ?
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.
jsonpatch.MergePatch
can't merge two JSON strings, and there are no other methods to merge JSON strings either.
See https://github.com/evanphx/json-patch#create-and-apply-a-merge-patch
can we also update the user docs https://gateway.envoyproxy.io/latest/user/customize-envoyproxy.html#customize-envoyproxy-bootstrap-config in this PR or as a follow up, thanks ! |
07ba10a
to
acc7ec1
Compare
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, thanks @zhaohuabing !
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
351184b
to
9fabd37
Compare
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 thanks !
Related issue: #1685
Since this is a breaking change, please consider including the following notification, or something similar, in the release note to remind the users to update their
EnvoyProxy
configuration.Important The
Booststrap
field ofEnvoyProxy
API has been changed from a string to a struct. Please ensure you adjust yourEnvoyProxy
configurations accordingly. Here is an example:Before:
After: