-
Notifications
You must be signed in to change notification settings - Fork 3k
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
hive: add support for map[string]string flags #25643
Conversation
/test |
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.
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.
Looks good, nothing to add on top of @mhofstetter's comments.
819b0fa
to
372d3f2
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 for the changes!
372d3f2
to
1954f42
Compare
Upon further testing, I noticed that I mistakenly used |
/test |
ConformanceKind and ConformanceIngress seem to have failed due to #25664. Manually rerunning. |
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 - just out of curiosity, what do we need this for?
It will be initially used to register the |
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.
@giorio94 Good work! ✨ One nit, otherwise LGTM. Approving with the understanding that changes are required prior to merge.
1954f42
to
a16d9ca
Compare
/test |
This commit adapts the logic which logs the registered flags to correctly output the value of flags of type StringMap. It was previously not working since vp.GetStringSlice returned an empty slice for such type of flags. Signed-off-by: Marco Iorio <[email protected]>
Introduce a decoding hook to convert from a string to the corresponding map[string]string representation when the target configuration entry is of the corresponding type. It reuses the same logic already adopted today outside of hive, assuming initially that the string is json encoded, and falling back to the KV format in case of errors. This allows to have a config struct contain map[string]string options, registering the corresponding flag through flags.StringToString. Signed-off-by: Marco Iorio <[email protected]>
Extend the "Guide to the Hive" documentation page, and in particular the Config section with an example concerning the registration of flags representing complex types (that is slices and maps), along with a comment explaining how parsing is performed. Signed-off-by: Marco Iorio <[email protected]>
a16d9ca
to
3d00736
Compare
Rebased onto main to pick the last changes and allow the Cilium Runtime checks to run successfully. |
/test Job 'Cilium-PR-K8s-1.25-kernel-4.19' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.25-kernel-4.19/267/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. |
/mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19 👍 created #25785 |
/test-1.25-4.19 |
Reporting the description of the main commit for convenience: