fix(network): match service containers by exact name or dotted prefix on network lookup

This commit is contained in:
2026-04-28 19:39:41 +00:00
parent a469a7e0ce
commit c7fb7fa55f
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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.'
}
+1 -1
View File
@@ -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;
}