-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[bitnami/external-dns] Fix bug with trailing comma in azure.json #33951
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
Conversation
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.
Hi there!
Thank you for your contribution @MaxAnderson95! I agree that using toJson
here is the way to go, but I'm worried about transforming the entire .Values.azure
into azure.json
.
In the future, extra values may be added under .Values.azure
that we may not want to add into the azure.json and cause issues for existing deployments by accident.
I would rather keep logic similar to how it currently is:
- Build a dict from scratch.
- Add key-values individually.
- Then convert the dict using
toJson
(instead of printing it line by line as it currently is).
It is not as pretty, but it would give us better control over what is included in the final Json.
If external-dns adds a new supported field for the azure.json
, then we just need to add a new value to the values.yaml and update the helper.
No worries, better safe than sorry! I'll get those changes pushed soon. EDIT: Changes pushed, ready for re-review |
@migruiz4 can you re-review this? |
Sorry for the notification spam. I screwed up trying to fix a merge conflict. Anyway I think we're good now. |
Signed-off-by: Max Anderson <[email protected]>
Signed-off-by: Bitnami Bot <[email protected]>
Signed-off-by: Bitnami Bot <[email protected]>
@migruiz4 sorry to bother, but do you mind re-reviewing the changes you requested? I keep having to re-base this PR because changes are being made in other branches. |
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.
I'm very sorry for the late response @MaxAnderson95, thank you for applying my suggestion!
This PR resolves #33882.
A breaking change was introduced in
external-dns
0.17.0
which now (correctly) fails to parse a previously innocuous bug in how theazure.json
was generated in this chart. Since the introduction of workload identity support in this chart (and likely before), the Azure credentials were generated by constructing a raw JSON string. When using only workload identity, this resulted in an invalidazure.json
containing a trailing comma on the last key-value pair:In
external-dns
0.16.1
this was apparently accepted as valid JSON and did not cause a parsing error. Since the upgrade to chart version8.8.3
which includedexternal-dns
0.17.0
, this is now causing a parsing error:Description of the change
This PR uses the
toJson
helm function to dynamically generate the JSON object, eliminating the need to worry about key order or trailing commas.Benefits
The method is much cleaner rather than constructing a raw string.
Possible drawbacks
One slight drawback is that falsey values now appear in the JSON object passed to
azure.json
.Before:
After:
I tested in one of my test clusters and had no issues, and I also reviewed the relevant parsing code and found no indication it would handle falsey values differently than non-existent keys.
Applicable issues
Checklist
Chart.yaml
according to semver. This is not necessary when the changes only affect README.md files.