ipmasq: Start the agent from its own cell, drop it from the IPAM path by HadrienPatte · Pull Request #48949 · cilium/cilium · GitHub
Skip to content

ipmasq: Start the agent from its own cell, drop it from the IPAM path - #48949

Merged
HadrienPatte merged 2 commits into
mainfrom
pr/HadrienPatte/ip-masq
Sep 29, 2026
Merged

HadrienPatte merged 2 commits into
mainfrom
pr/HadrienPatte/ip-masq

Conversation

@HadrienPatte

Copy link
Copy Markdown
Member

The ip-masq-agent has no in-process consumer, it exists for its side effects on the BPF ipmasq map. Its only callers were the two NonMasqCIDRsFromConfig() calls that appended to AllocationResult.CIDRs, and those CIDRs were removed in #48818.

Removing *ipmasq.IPMasqAgent from the IPAM cells would cause the ipmasq cell.Provide constructor to no longer get called and lead the --enable-ip-masq-agent flag value to get ignored. To prevent this, this PR moves the ipmasq agent construction and registration from a Provide to an Invoke so that it always runs, even if nothing explicitely depends on any side effect it produces.

@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 22, 2026
@HadrienPatte HadrienPatte added the release-note/misc This PR makes changes that have no direct user impact. label Sep 22, 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 22, 2026
@HadrienPatte

This comment has been minimized.

@HadrienPatte
HadrienPatte marked this pull request as ready for review September 22, 2026 23:32
@HadrienPatte
HadrienPatte requested review from a team as code owners September 22, 2026 23:32

@tamilmani1989 tamilmani1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good from azure side

Comment thread pkg/ipmasq/cell/cell_test.go Outdated
Comment thread pkg/ipmasq/cell/cell_test.go Outdated
@HadrienPatte
HadrienPatte force-pushed the pr/HadrienPatte/ip-masq branch from 881e988 to 1b6e568 Compare September 27, 2026 20:26
The ip-masq-agent has no in-process consumer: it exists for its side
effects on the BPF ipmasq map. Constructing it with a cell.Provide means
it would only run as long as something else in the hive happened to depend
on *ipmasq.IPMasqAgent, and hive constructors are lazy, so losing the last
consumer would silently turn --enable-ip-masq-agent into a no-op.

Construct and register it from a cell.Invoke instead. The agent is no
longer part of the object graph, so the module no longer depends on an
unrelated caller to stay loaded.

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
With the CIDRs gone from the allocation result, the ip-masq-agent has no
reader left in the IPAM path. Its only consumers were the two
`NonMasqCIDRsFromConfig()` calls that appended to `AllocationResult.CIDRs`.

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
@HadrienPatte

This comment has been minimized.

@antonipp antonipp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@HadrienPatte
HadrienPatte added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit e7747e5 Sep 29, 2026
453 checks passed
@HadrienPatte
HadrienPatte deleted the pr/HadrienPatte/ip-masq branch September 29, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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