Skip to content

Commit

Permalink
Deprecate MacAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
dmandalidis committed Feb 1, 2024
1 parent b79157c commit 7c6416a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public interface ContainerConfig {
@JsonProperty("Labels")
Map<String, String> labels();

@Deprecated
@Nullable
@JsonProperty("MacAddress")
String macAddress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public interface NetworkSettings {
@JsonProperty("Bridge")
String bridge();

// TODO: API break: Return null values
@Nullable
@JsonProperty("PortMapping")
Map<String, Map<String, String>> portMapping();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import static java.util.Collections.singletonMap;
import static java.util.Collections.unmodifiableList;
import static java.util.stream.Collectors.toList;
import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
Expand Down Expand Up @@ -855,27 +854,6 @@ public void testBuildNoCache() throws Exception {
assertThat(message.stream(), not(containsString(usingCache))), BuildParam.noCache());
}

@Test
public void testBuildNoRm() throws Exception {
final Path dockerDirectory = getResource("dockerDirectory");
final String removingContainers = "Removing intermediate container";

// Test that intermediate containers are removed with FORCE_RM by parsing output. We must
// set NO_CACHE so that docker will generate some containers to remove.
final AtomicBoolean removedContainer = new AtomicBoolean(false);
sut.build(dockerDirectory, "test", message -> {
if (containsIgnoreCase(message.stream(), removingContainers)) {
removedContainer.set(true);
}
}, BuildParam.noCache(), BuildParam.forceRm());
assertTrue(removedContainer.get());

// Set NO_RM and verify we don't get message that containers were removed.
sut.build(dockerDirectory, "test", message ->
assertThat(message.stream(), not(containsString(removingContainers))),
BuildParam.noCache(), BuildParam.rm(false));
}

@Test
public void testBuild() throws Exception {
// The Dockerfile specifies a sleep of 10s during the build
Expand Down Expand Up @@ -3098,7 +3076,7 @@ public void testMacAddress() throws Exception {
sut.startContainer(container.id());
final ContainerInfo containerInfo = sut.inspectContainer(container.id());
assertThat(containerInfo, notNullValue());
assertThat(containerInfo.config().macAddress(), equalTo("12:34:56:78:9a:bc"));
assertThat(containerInfo.networkSettings().macAddress(), equalTo("12:34:56:78:9a:bc"));
}

@Test(expected = NetworkNotFoundException.class)
Expand Down

0 comments on commit 7c6416a

Please sign in to comment.