Skip to content

Commit

Permalink
Do not pass cni and flannel.* devices to Cobbler
Browse files Browse the repository at this point in the history
  • Loading branch information
meaksh committed Jul 23, 2024
1 parent aac1c92 commit 912b115
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,13 @@ public boolean isBond() {
* @return true if the nic is a container network
*/
public boolean isContainerNetwork() {
return ("bridge".equals(module) && (getName().startsWith("docker") || getName().startsWith("cni-podman") || getName().startsWith("podman")));
return (
"bridge".equals(module) && (
getName().startsWith("docker") ||
getName().startsWith("cni-podman") ||
getName().startsWith("podman") ||
getName().startsWith("cni")
) || getName().startsWith("flannel"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ public void testIsContainerNetwork() throws Exception {
netint1.setModule("bridge");
netint1.setName("cni-podman0");
assertTrue(netint1.isContainerNetwork());
netint1.setModule("bridge");
netint1.setName("cni0");
assertTrue(netint1.isContainerNetwork());
netint1.setModule("foobar");
netint1.setName("flannel.1");
assertTrue(netint1.isContainerNetwork());
netint1.setModule("foobar");
netint1.setName("eth0");
assertFalse(netint1.isContainerNetwork());
}

/**
Expand Down

0 comments on commit 912b115

Please sign in to comment.