Skip to content

Commit

Permalink
[apache#1779] fix(IT): Fix container network configuration error (apa…
Browse files Browse the repository at this point in the history
…che#2465)

### What changes were proposed in this pull request?

1. Enhancing code robustness.
2. Fix container network configuration error 

### Why are the changes needed?

There are some versions of docker where this issue occurs

Fix: apache#1779

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

CI Passed
  • Loading branch information
xunliu authored Mar 8, 2024
1 parent 939e073 commit 1bc35a3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ContainerSuite implements Closeable {
// The subnet must match the configuration in `dev/docker/tools/mac-docker-connector.conf`
public static final String CONTAINER_NETWORK_SUBNET = "10.20.30.0/28";
private static final String CONTAINER_NETWORK_GATEWAY = "10.20.30.1";
private static final String CONTAINER_NETWORK_IPRANGE = "10.20.30.14/28";
private static final String CONTAINER_NETWORK_IPRANGE = "10.20.30.0/28";
private static final String NETWORK_NAME = "gravitino-ci-network";

private static Network network = null;
Expand Down Expand Up @@ -160,6 +160,9 @@ private static Network createDockerNetwork() {

for (com.github.dockerjava.api.model.Network network : networks) {
List<Config> ipamConfigs = network.getIpam().getConfig();
if (ipamConfigs == null) {
continue;
}
for (Config ipamConfig : ipamConfigs) {
try {
if (ipRangesOverlap(ipamConfig.getSubnet(), CONTAINER_NETWORK_SUBNET)) {
Expand Down

0 comments on commit 1bc35a3

Please sign in to comment.