hive: Remove redundant netip.Prefix config decode hook by HadrienPatte · Pull Request #49090 · cilium/cilium · GitHub
Skip to content

hive: Remove redundant netip.Prefix config decode hook - #49090

Merged
joestringer merged 1 commit into
mainfrom
pr/HadrienPatte/decode-hooks
Sep 30, 2026
Merged

joestringer merged 1 commit into
mainfrom
pr/HadrienPatte/decode-hooks

Conversation

@HadrienPatte

Copy link
Copy Markdown
Member

cilium/hive v1.0.6 includes cilium/hive#79, which adds mapstructure.TextUnmarshallerHookFunc() to the default config decode hooks. Config fields of any type implementing encoding.TextUnmarshaler, including netip.Prefix, now decode out of the box.

The default hooks run before the extra hooks passed via Options.DecodeHooks, so the netip.Prefix hook in pkg/hive never sees a string input anymore and is dead code. Remove it, along with the associated TODO, which waited on go-viper/mapstructure#85 and is now obsolete.

`cilium/hive` v1.0.6 includes cilium/hive#79, which adds
`mapstructure.TextUnmarshallerHookFunc()` to the default config decode
hooks. Config fields of any type implementing `encoding.TextUnmarshaler`,
including `netip.Prefix`, now decode out of the box.

The default hooks run before the extra hooks passed via
`Options.DecodeHooks`, so the `netip.Prefix` hook in `pkg/hive` never sees
a string input anymore and is dead code. Remove it, along with the
associated TODO, which waited on go-viper/mapstructure#85 and is now
obsolete.

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
@maintainer-s-little-helper maintainer-s-little-helper Bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 29, 2026
@HadrienPatte HadrienPatte added kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. labels Sep 29, 2026
@maintainer-s-little-helper maintainer-s-little-helper Bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 29, 2026
@HadrienPatte

This comment has been minimized.

@HadrienPatte
HadrienPatte marked this pull request as ready for review September 29, 2026 15:08
@HadrienPatte
HadrienPatte requested a review from a team as a code owner September 29, 2026 15:08
@maintainer-s-little-helper maintainer-s-little-helper Bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 30, 2026
@joestringer
joestringer added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit a3a11c2 Sep 30, 2026
480 of 482 checks passed
@joestringer
joestringer deleted the pr/HadrienPatte/decode-hooks branch September 30, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup This includes no functional changes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants