-
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
cni: Use batch endpoint deletion API in chaining plugin #31456
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Mar 18, 2024
sayboras
added
release-note/bug
This PR fixes an issue in a previous release of Cilium.
needs-backport/1.15
This PR / issue needs backporting to the v1.15 branch
labels
Mar 18, 2024
maintainer-s-little-helper
bot
removed
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
labels
Mar 18, 2024
/test |
This commit is to leverage new batch endpoint deletion API instead of singular endpoint deletion based on ID. The main reason is to provide backward compatibility on upgrade path. The current CNI attachment ID requires a valid containerIfName attribute, however, the endpoints created by old cilium versions (e.g. <1.15) are not having such details. Any CNI DEL command for these endpoints will lead to invalid lookup (e.g. DeleteEndpointIDNotFoundCode), and prevent cleaning up of related resources such as IP addresses. The impact is only limited to CNI chaining mode, as batch endpoint deletion API is already used cilium-cni/cmd/cmd.go as part of cilium#27351. Old endpoint details without (or empty) ContainerIfName ```json { "ID": 423, "ContainerName": "", "dockerID": "415beb119c4b0910f62634510e921a447893195ebedc30ca0e9cd5bf02569645", "DockerNetworkID": "", "DockerEndpointID": "", "IfName": "eni22524e9e591", "IfIndex": 13, "ContainerIfName": "", "DisableLegacyIdentifiers": false, ... } ``` New endpoint details with valid ContainerIfName (e.g. eth0) ```json { "ID": 3627, "ContainerName": "", "dockerID": "f89ccf654b878248442981d4c56fe3f50fa127f922b46ee6dccc94ae10e94b79", "DockerNetworkID": "", "DockerEndpointID": "", "IfName": "enia67a2d3c27d", "IfIndex": 45, "ContainerIfName": "eth0", "DisableLegacyIdentifiers": false, ... } ``` Relates: cilium#26894, cilium#27351 Suggested-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Tam Mach <tam.mach@cilium.io>
sayboras
force-pushed
the
tam/cni-delete
branch
from
March 18, 2024 22:26
c9eac12
to
afcbb14
Compare
/test |
gandro
approved these changes
Mar 19, 2024
youngnick
approved these changes
Mar 19, 2024
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 19, 2024
sayboras
added
the
backport/author
The backport will be carried out by the author of the PR.
label
Mar 20, 2024
sayboras
added
backport-pending/1.15
The backport for Cilium 1.15.x for this PR is in progress.
backport-done/1.14
The backport for Cilium 1.14.x for this PR is done.
needs-backport/1.14
This PR / issue needs backporting to the v1.14 branch
and removed
needs-backport/1.15
This PR / issue needs backporting to the v1.15 branch
backport-done/1.14
The backport for Cilium 1.14.x for this PR is done.
labels
Mar 20, 2024
github-actions
bot
added
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
and removed
backport-pending/1.15
The backport for Cilium 1.15.x for this PR is in progress.
labels
Mar 20, 2024
sayboras
removed
the
needs-backport/1.14
This PR / issue needs backporting to the v1.14 branch
label
Mar 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects/v1.14
This issue affects v1.14 branch
backport/author
The backport will be carried out by the author of the PR.
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit is to leverage new batch endpoint deletion API instead of singular endpoint deletion based on ID. The main reason is to provide backward compatibility on upgrade path.
The current CNI attachment ID requires a valid containerIfName attribute, however, the endpoints created by old cilium versions (e.g. <1.15) are not having such details. Any CNI DEL command for these endpoints will lead to invalid lookup (e.g. DeleteEndpointIDNotFoundCode), and prevent cleaning up of related resources such as IP addresses.
The impact is only limited to CNI chaining mode, as batch endpoint deletion API is already used cilium-cni/cmd/cmd.go as part of #27351.
Old endpoint details without (or empty) ContainerIfName
New endpoint details with valid ContainerIfName (e.g. eth0)
Relates: #26894, #27351
Suggested-by: Sebastian Wicki sebastian@isovalent.com