-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[confighttp] Use configoptional.Optional
for optional fields
#13109
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
Merged
mx-psi
merged 24 commits into
open-telemetry:main
from
mx-psi:mx-psi/use-configoptional-in-confighttp
Jul 7, 2025
Merged
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8f6eb27
[confighttp] Add optional type to tls
mx-psi 1ba683d
[confighttp] Use configoptional.Optional for CORS config
mx-psi 6ea68c5
[confighttp] Use configoptional.Optional for Auth config
mx-psi 7092009
[confighttp] Rename TLSSetting fields to TLS in ServerConfig
mx-psi 8793522
[confighttp] Rename TLSSetting field to TLS in ClientConfig
mx-psi b8a4d7a
[confighttp] Remove pointers from remaining fields
mx-psi 40b96b6
Fix toolchain directive
mx-psi 901270a
Add changelog entries
mx-psi 0430f78
Use Default instead of None (does not make a difference but oh well)
mx-psi ffd62e7
make crosslink
mx-psi 17976dd
Some, not default
mx-psi a33082f
Merge branch 'main' into mx-psi/use-configoptional-in-confighttp
mx-psi 7a14748
Merge remote-tracking branch 'origin/main' into mx-psi/use-configopti…
mx-psi 26f8bfa
Merge remote-tracking branch 'origin/main' into mx-psi/use-configopti…
mx-psi f13be0b
Fix merge
mx-psi 1051beb
Remove release note that is no longer needed, use proper versions for…
mx-psi 8bf3df7
Make CI happy
mx-psi b7c1e4d
Fix test
mx-psi 77c514d
o.notNone = true
mx-psi d2678d8
Merge remote-tracking branch 'origin/main' into mx-psi/use-configopti…
mx-psi 84c962f
Merge branch 'main' into mx-psi/use-configoptional-in-confighttp
mx-psi b242c43
Merge branch 'main' into mx-psi/use-configoptional-in-confighttp
mx-psi 5489fb4
Fix tests
mx-psi 483cb80
Fix versioning
mx-psi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
.chloggen/mx-psi_use-configoptional-in-confighttp-tls.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: breaking | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: confighttp | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Rename `ClientConfig.TLSSetting` and `ServerConfig.TLSSetting` to `ClientConfig.TLS` and `ServerConfig.TLS`." | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [9478] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [api] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: breaking | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: confighttp | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Use configooptional.Optional in confighttp" | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [9478] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [api] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is zero-value of Optional a None value?
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.
also, I am curious how
omitempty
works for Optional. It seems like the output formatter, when do we use it?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.
Yep
omitempty
will omitNone
values (since it omits any zero values). It's used byconfmap.Marshal
which is used for things like OpAMP (to report the effective configuration to a backend)