Compare commits

...

4 Commits

5 changed files with 20 additions and 5 deletions
+12
View File
@@ -1,5 +1,17 @@
# Changelog # Changelog
## 2026-04-28 - 5.1.4 - fix(network)
match service containers by exact name or dotted prefix on network lookup
- Updates network service container filtering to include exact service names in addition to replicated task-style names with a dotted suffix.
- Prevents unrelated containers with similarly prefixed names from being incorrectly matched during network lookup.
## 2026-04-28 - 5.1.3 - fix(docker-service)
move swarm service networks into task template and correct service typings
- Moves the Networks configuration from the service root into TaskTemplate when creating services.
- Updates the service type definition to reflect the Networks structure expected by swarm services.
## 2026-03-28 - 5.1.2 - fix(deps) ## 2026-03-28 - 5.1.2 - fix(deps)
upgrade core tooling dependencies and adapt Docker client internals for compatibility upgrade core tooling dependencies and adapt Docker client internals for compatibility
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@apiclient.xyz/docker", "name": "@apiclient.xyz/docker",
"version": "5.1.2", "version": "5.1.4",
"description": "Provides easy communication with Docker remote API from Node.js, with TypeScript support.", "description": "Provides easy communication with Docker remote API from Node.js, with TypeScript support.",
"private": false, "private": false,
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
+1 -1
View File
@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@apiclient.xyz/docker', name: '@apiclient.xyz/docker',
version: '5.1.2', version: '5.1.4',
description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.' description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.'
} }
+1 -1
View File
@@ -145,7 +145,7 @@ export class DockerNetwork extends DockerResource {
public async getContainersOnNetworkForService(serviceArg: DockerService) { public async getContainersOnNetworkForService(serviceArg: DockerService) {
const containersOnNetwork = await this.listContainersOnNetwork(); const containersOnNetwork = await this.listContainersOnNetwork();
const containersOfService = containersOnNetwork.filter((container) => { const containersOfService = containersOnNetwork.filter((container) => {
return container.Name.startsWith(serviceArg.Spec.Name); return container.Name === serviceArg.Spec.Name || container.Name.startsWith(`${serviceArg.Spec.Name}.`);
}); });
return containersOfService; return containersOfService;
} }
+5 -2
View File
@@ -205,6 +205,7 @@ export class DockerService extends DockerResource {
Resources: { Resources: {
Limits: limits, Limits: limits,
}, },
Networks: networkArray,
LogDriver: { LogDriver: {
Name: 'json-file', Name: 'json-file',
Options: { Options: {
@@ -214,7 +215,6 @@ export class DockerService extends DockerResource {
}, },
}, },
Labels: labels, Labels: labels,
Networks: networkArray,
EndpointSpec: { EndpointSpec: {
Ports: ports, Ports: ports,
}, },
@@ -253,9 +253,12 @@ export class DockerService extends DockerResource {
}>; }>;
}; };
ForceUpdate: 0; ForceUpdate: 0;
Networks: Array<{
Target: string;
Aliases: string[];
}>;
}; };
Mode: {}; Mode: {};
Networks: [any[]];
}; };
public Endpoint!: { Spec: {}; VirtualIPs: [any[]] }; public Endpoint!: { Spec: {}; VirtualIPs: [any[]] };