diff --git a/changelog.md b/changelog.md index 00a98e4..725a812 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # 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 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index be7344e..82c8d64 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiclient.xyz/docker', - version: '5.1.3', + version: '5.1.4', description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.' } diff --git a/ts/classes.network.ts b/ts/classes.network.ts index 3ccf10e..5a3f286 100644 --- a/ts/classes.network.ts +++ b/ts/classes.network.ts @@ -145,7 +145,7 @@ export class DockerNetwork extends DockerResource { public async getContainersOnNetworkForService(serviceArg: DockerService) { const containersOnNetwork = await this.listContainersOnNetwork(); 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; }