From 1bc35a3a2cd722c71d216cd241a1ca53a4a41955 Mon Sep 17 00:00:00 2001 From: Xun Liu Date: Fri, 8 Mar 2024 14:32:39 +0800 Subject: [PATCH] [#1779] fix(IT): Fix container network configuration error (#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: #1779 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? CI Passed --- .../gravitino/integration/test/container/ContainerSuite.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java index 591a80802d2..71161356b0d 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java @@ -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; @@ -160,6 +160,9 @@ private static Network createDockerNetwork() { for (com.github.dockerjava.api.model.Network network : networks) { List ipamConfigs = network.getIpam().getConfig(); + if (ipamConfigs == null) { + continue; + } for (Config ipamConfig : ipamConfigs) { try { if (ipRangesOverlap(ipamConfig.getSubnet(), CONTAINER_NETWORK_SUBNET)) {