forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip loading openvswitch Kernel module if built-in
If a module is built-in, trying to load the module with modprobe inside a container may fail (insted of just being a no-op). This will cause Antrea initialization to fail unless agent.dontLoadKernelModules is explicitly set to true. Now that the Docker Desktop LinuxKit VM comes with openvswitch built-in (starting with 4.27.0), trying to install "default" Antrea (i.e., without setting agent.dontLoadKernelModules) in a Kind cluster running with Docker Desktop on macOS will fail. To make sure that users will not run into this issue, we add logic to the install_cni script to skip the modprobe call if the module is built-in. After this agent, there should be very limited use cases for the agent.dontLoadKernelModules parameter, but there is no harm in keeping in case it is needed in the future or for some corner cases. I also realized that the "--skip-kmod" flag for the start_ovs script did not provide any value. Either the openvswitch module needs to be explicitly loaded, in which case the install_cni script will take care of it anyway, or it should not be loaded at all (e.g., because it is built-in). Additionally, because we do not mount the host's /lib/modules to the antrea-ovs container, it is not possible to load any kernel module from the container. Fixes antrea-io#5939 Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
- Loading branch information
1 parent
84e23bc
commit 8fe8a4a
Showing
7 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2024 Antrea Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
function is_module_builtin { | ||
local module="$1" | ||
local path="/lib/modules/$(uname -r)/modules.builtin" | ||
grep -q "$module\.ko" "$path" | ||
} |
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