-
Notifications
You must be signed in to change notification settings - Fork 338
chore: 'omitempty' to Oauth2 fields with type Secret to avoid requiring them #864
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
…ng them Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
|
Why not set omitempty to all fields? We got hit by this too in the past when operating things with different versions (operator vs operated thing) using Prometheus config with a new field without omitempty. |
|
|
Everywhere. At some point I was even adding global options to some YAML projects: goccy/go-yaml#691 ;p Is there a disadvantage? We never assume something because we don't see the field vs default value (: (we have healthy defaults) |
|
Anyway, let's merge this now . |
|
I was updating the branch.. xD Maybe another a follow-up PR or just if someone comes again and cry like me xD |
|
Could I ask for a new release? (if it's not planned already). I'll take the new version and update my PRs on otel-collector and prometheus |
|
follow PR is great, sorry for merging too quickly! |
|
Should we add this follow up first, before release? |
Sure! I'm going to prepare it in a couple of minutes and we can ship both together actually |
|
well... All the other Should I add it for |
After the PR supporting the RFC7523, there are 2 fields with Secret type inside the Oauth2 struct. This isn't a problem at all, but there are some yaml marshalers in other projects using this pkg (I've discovered this bumping the dep in otel-collector) and they can fail during the marshaling process because one (or more of them) can be empty and it's trying to execute custom marshal logic.
Probably the best option should be handling the case everywhere where custom logic is applied, but it's also true that adding omitempty tag in the source solves it for any usecase.
I've tested this change directly there and it works perfectly