-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ess space (#1234) ### What changes were proposed in this pull request? 1. Added Docker network overlap detection 2. Reduced IP allocation ranges for lower conflict probability, Modified to `10.20.30.0/28` only allocate IP ranger `10.20.30.1` ~ `10.20.30.14` 3. Docker network only created on MacOS and default Docker server environment ### Why are the changes needed? Fix: #879, #925 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? CI Co-authored-by: Xun Liu <xun@datastrato.com>
- Loading branch information
1 parent
631b579
commit b2136bb
Showing
5 changed files
with
145 additions
and
7 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
24 changes: 24 additions & 0 deletions
24
...c/test/java/com/datastrato/gravitino/integration/test/container/NetworksConflictTest.java
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,24 @@ | ||
/* | ||
* Copyright 2023 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.gravitino.integration.test.container; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class NetworksConflictTest { | ||
@Test | ||
public void networksConflictTest1() throws Exception { | ||
final String subnet1 = "10.20.30.0/28"; // allocate IP ranger 10.20.30.1 ~ 10.20.30.14 | ||
final String subnet2 = "10.20.30.0/26"; // allocate IP ranger is 10.20.30.1 ~ 10.20.30.62 | ||
Assertions.assertTrue(ContainerSuite.ipRangesOverlap(subnet1, subnet2)); | ||
} | ||
|
||
@Test | ||
public void networksConflictTest2() throws Exception { | ||
final String subnet1 = "10.20.30.0/28"; // allocate IP ranger is 10.20.30.1 ~ 10.20.30.14 | ||
final String subnet2 = "10.20.31.0/28"; // allocate IP ranger is 10.20.31.1 ~ 10.20.31.14 | ||
Assertions.assertFalse(ContainerSuite.ipRangesOverlap(subnet1, subnet2)); | ||
} | ||
} |