Skip to content
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

[v1.14] iptables: Read CNI chaining mode from CNI config manager #31265

Conversation

pippolo84
Copy link
Member

@pippolo84 pippolo84 commented Mar 9, 2024

Author Backport of #30766

iptables does not live in its own cell in v1.14, so we cannot rely on hive dependency injection to get a reference to the CNIConfigManager. Instead, the reference is passed explicitly in the iptables Init method, just after its instantiation during datapath initialization.

[ upstream commit: 77053ae ]

[ backporter's note: iptables does not have its own cell in v1.14, thus
the reference to the CNIConfigManager is passed in the Init method. ]

CNI chaining mode option has been moved to the CNI cell in commit
1254bf4.

Since it is not a global config option anymore, iptables manager will
not see any change to that value, and its field `CNIChainingMode` will
always be an empty string.
Thus, with the following config option values:

- "enable-endpoint-routes": true
- "cni-chaining-mode": "aws-cni"

the delivery interface referenced in the rules installed by the manager
is "lxc+" instead of "eni+".

This commit fixes this adding a CNI config manager reference to the
iptables manager parameters, in order to read the current setting for
the chaining mode during rules installation.

Fixes: 1254bf4 ("daemon / cni: move to Cell, watch for changes")

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
@pippolo84 pippolo84 added kind/backports This PR provides functionality previously merged into master. backport/1.14 This PR represents a backport for Cilium 1.14.x of a PR that was merged to main. labels Mar 9, 2024
@pippolo84 pippolo84 marked this pull request as ready for review March 10, 2024 09:47
@pippolo84 pippolo84 requested a review from a team as a code owner March 10, 2024 09:47
@pippolo84
Copy link
Member Author

/test-backport-1.14

@pippolo84 pippolo84 changed the title iptables: [v1.14] Author Backport of #30766 - Read CNI chaining mode from CNI config manager [v1.14] iptables: Read CNI chaining mode from CNI config manager Mar 10, 2024
@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 Mar 11, 2024
@julianwiedmann julianwiedmann merged commit b59164c into cilium:v1.14 Mar 11, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.14 This PR represents a backport for Cilium 1.14.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants