fix(core): update

This commit is contained in:
Philipp Kunz 2019-09-22 23:42:29 +02:00
parent 0b3e3b68c9
commit 71c89ac9bc
3 changed files with 16 additions and 3 deletions

View File

@ -26,7 +26,8 @@ tap.test('should list networks', async () => {
tap.test('should create a network', async () => {
const newNetwork = await docker.DockerNetwork.createNetwork(testDockerHost, {
Name: 'webgateway'
Name: 'webgateway',
NetworkNumber: 10
});
expect(newNetwork).to.be.instanceOf(docker.DockerNetwork);
expect(newNetwork.Name).to.equal('webgateway');
@ -84,7 +85,8 @@ tap.test('should list all services', async tools => {
tap.test('should create a service', async () => {
const testNetwork = await docker.DockerNetwork.createNetwork(testDockerHost, {
Name: 'testNetwork'
Name: 'testNetwork',
NetworkNumber: 11
});
const testSecret = await docker.DockerSecret.createSecret(testDockerHost, {
name: 'testSecret',

View File

@ -29,7 +29,17 @@ export class DockerNetwork {
Name: networkCreationDescriptor.Name,
CheckDuplicate: true,
Driver: 'overlay',
EnableIPv6: false,
EnableIPv6: true,
IPAM: {
Driver: 'default',
Config: [
{
Subnet: `172.20.${networkCreationDescriptor.NetworkNumber}.0/16`,
IPRange: `172.20.${networkCreationDescriptor.NetworkNumber}.0/24`,
Gateway: `172.20.${networkCreationDescriptor.NetworkNumber}.11`
}
]
},
Internal: true,
Attachable: true,
Ingress: false

View File

@ -3,4 +3,5 @@
*/
export interface INetworkCreationDescriptor {
Name: string;
NetworkNumber: number;
}