Skip to content

pkg/endpoint: Store and restore parentIfIndex #39575

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

Conversation

dylandreimerink
Copy link
Member

In #35298 endpoints got the parentIfIndex field to store the parent interface index, which is used to ensure endpoint traffic is routed out of the parent interface when set.

This interface index is given to the agent by the CNI plugin and stored in the endpoint object. However, when the agent is restarted, it has to restore endpoint state from disk. The parentIfIndex field was not being stored or restored, so after a restart the parentIfIndex would be set to 0, which would cause the agent to not route traffic out of the parent interface.

This commit adds the parentIfIndex field to the endpoint state serialization and deserialization process, so that it is stored and restored correctly.

Persist parent interface index of endpoint across agent restarts

@dylandreimerink dylandreimerink added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch labels May 16, 2025
@dylandreimerink dylandreimerink force-pushed the feature/restore-parentIfIndex branch 2 times, most recently from ec20a0b to 89fb961 Compare May 22, 2025 08:33
In cilium#35298 endpoints got the parentIfIndex field to store the parent
interface index, which is used to ensure endpoint traffic is routed
out of the parent interface when set.

This interface index is given to the agent by the CNI plugin and stored
in the endpoint object. However, when the agent is restarted, it has
to restore endpoint state from disk. The parentIfIndex field was not
being stored or restored, so after a restart the parentIfIndex would be
set to 0, which would cause the agent to not route traffic out of the
parent interface.

This commit adds the parentIfIndex field to the endpoint state
serialization and deserialization process, so that it is stored and
restored correctly.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@dylandreimerink dylandreimerink force-pushed the feature/restore-parentIfIndex branch from 89fb961 to 0f069d6 Compare May 22, 2025 09:47
@dylandreimerink
Copy link
Member Author

/test

@dylandreimerink dylandreimerink marked this pull request as ready for review May 22, 2025 10:32
@dylandreimerink dylandreimerink requested review from a team as code owners May 22, 2025 10:32
@dylandreimerink dylandreimerink requested a review from squeed May 22, 2025 10:32
@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 May 26, 2025
@julianwiedmann julianwiedmann added the area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. label May 26, 2025
@julianwiedmann julianwiedmann added this pull request to the merge queue May 26, 2025
Merged via the queue into cilium:main with commit 0b6adf6 May 26, 2025
73 checks passed
@julianwiedmann julianwiedmann added backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. and removed needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch labels May 28, 2025
@github-actions github-actions bot added backport-done/1.17 The backport for Cilium 1.17.x for this PR is done. and removed backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. backport-done/1.17 The backport for Cilium 1.17.x for this PR is done. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants