Add ability to configure IPAM config for CreateNetworkCmd by vuminhkh · Pull Request #550 · docker-java/docker-java

@vuminhkh

Hi,

I'm fixing a minor issue in network creation API. Please let me know if it's ok for you. Thanks.

Regards,

Minh Khang VU


This change is Reviewable

@codecov-io

Current coverage is 23.78%

Merging #550 into master will decrease coverage by -0.03% as of cc0beb0

@@            master    #550   diff @@
======================================
  Files          296     296       
  Stmts         6123    6131     +8
  Branches       532     533     +1
  Methods          0       0       
======================================
  Hit           1458    1458       
  Partial         85      85       
- Missed        4580    4588     +8

Review entire Coverage Diff as of cc0beb0

Powered by Codecov. Updated on successful CI builds.

KostyaSha

CreateNetworkResponse createNetworkResponse = dockerClient.createNetworkCmd().withName(networkName).exec();
Network.Ipam.Config config = new Network.Ipam.Config();
config.setSubnet("10.67.79.0/24");
CreateNetworkResponse createNetworkResponse = dockerClient.createNetworkCmd().withName(networkName).withIpamConfig(config).exec();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create separate test

@vuminhkh

@vuminhkh

KostyaSha

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.testng.annotations.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use hash imports

@vuminhkh

@vuminhkh

@marcuslinke

@vuminhkh Please rename tests to createNetworkWithIpamConfig. Thanks! Beside this it LGTM. @KostyaSha WDYT?

@vuminhkh

@marcuslinke

marcuslinke

if (this.ipam == null) {
this.ipam = new Ipam();
}
this.ipam.getConfig().add(config);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. In this line.