-
Notifications
You must be signed in to change notification settings - Fork 3.4k
config: Remove superfluous warning on native routing CIDR #35738
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
pchaigno
merged 1 commit into
cilium:main
from
gandro:pr/gandro/fix-native-routing-cidr-warning
Nov 4, 2024
Merged
config: Remove superfluous warning on native routing CIDR #35738
pchaigno
merged 1 commit into
cilium:main
from
gandro:pr/gandro/fix-native-routing-cidr-warning
Nov 4, 2024
Conversation
This file contains hidden or 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
This commit removes a warning that was intended to warn the user that running in native routing mode without a correct native routing CIDR will lead to problems. However, the conditions for the warning are not fully correct. There are native routing setups where the user does not need to specify a native routing CIDR, namely: 1. The user is running in ENI or AlibabaCloud IPAM, where the native routing CIDR is auto-detected if not explicitly configured. 2. The user is running with BPF ip-masq-agent where the native routing CIDR is optional (as there are other means of specifying exclusion CIDRs). 3. The user is not running with Cilium-based masquerading. The existing warning did not trigger for case 1, as the if condition checked for `auto-direct-node-routes` rather than the `routing-mode` flag, and `auto-direct-node-routes` is not used on ENI/AlibabaCloud IPAM modes. However, the warning would trigger for cases 2 and 3, which is incorrect. Cases 2 and 3 should not emit a warning either. And indeed already have a check on the native routing CIDR that handles all three cases correctly, namely `checkIPv{4,6}NativeRoutingCIDR` here: https://github.com/cilium/cilium/blob/bc26c6d3a74e3bfbeb1149e5116de51c496dd254/pkg/option/config.go#L3451-L3476 Therefore, we can safely remove the warning in this commit, as the conditions are already covered by `checkIPv{4,6}NativeRoutingCIDR`. I have also manually tested that the check does take effect if one sets `routingMode=native` and `autoDirectNodeRoutes=true` without specifying a native routing CIDR. Fixes: 6743d28 ("daemon: warn if auto direct node routes is set without a native routing CIDR") Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
pchaigno
approved these changes
Nov 4, 2024
/test |
bimmlerd
approved these changes
Nov 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your reasoning makes sense to me, but cc @jibi as the original author.
derailed
approved these changes
Nov 4, 2024
This was referenced Nov 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
backport-done/1.16
The backport for Cilium 1.16.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 removes a warning that was intended to warn the user that running in native routing mode without a correct native routing CIDR will lead to problems.
However, the conditions for the warning are not fully correct. There are native routing setups where the user does not need to specify a native routing CIDR, namely:
The existing warning did not trigger for case 1, as the if condition checked for
auto-direct-node-routes
rather than therouting-mode
flag, andauto-direct-node-routes
is not used on ENI/AlibabaCloud IPAM modes.However, the warning would trigger for cases 2 and 3, which is incorrect. Cases 2 and 3 should not emit a warning either. And indeed already have a check on the native routing CIDR that handles all three cases correctly, namely
checkIPv{4,6}NativeRoutingCIDR
here:cilium/pkg/option/config.go
Lines 3451 to 3476 in bc26c6d
Therefore, we can safely remove the warning in this commit, as the conditions are already covered by
checkIPv{4,6}NativeRoutingCIDR
. I have also manually tested that the check does take effect if one setsroutingMode=native
andautoDirectNodeRoutes=true
without specifying a native routing CIDR.Fixes: 6743d28 ("daemon: warn if auto direct node routes is set without a native routing CIDR")
Note: This commit also fixes an issue with the
Conformance Multi-Pool
workflow where this warning was wrongfully emitted (as that workflow uses BPF ip-masq-agent). Therefore, I have marked this PR to be backported to 1.16 and v1.15, as those versions do allow BPF ip-masq-agent to be run without an explicit native routing CIDR.