From 137672a5cdba82d32c8029577dfd67877dcedc2b Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 28 Apr 2026 19:38:26 +0000 Subject: [PATCH] fix(docker-service): move swarm service networks into task template and correct service typings --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.service.ts | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index f054e0b..00a98e4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 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) upgrade core tooling dependencies and adapt Docker client internals for compatibility diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 899a143..be7344e 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.2', + version: '5.1.3', description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.' } diff --git a/ts/classes.service.ts b/ts/classes.service.ts index e49789f..52fdbad 100644 --- a/ts/classes.service.ts +++ b/ts/classes.service.ts @@ -205,6 +205,7 @@ export class DockerService extends DockerResource { Resources: { Limits: limits, }, + Networks: networkArray, LogDriver: { Name: 'json-file', Options: { @@ -214,7 +215,6 @@ export class DockerService extends DockerResource { }, }, Labels: labels, - Networks: networkArray, EndpointSpec: { Ports: ports, }, @@ -253,9 +253,12 @@ export class DockerService extends DockerResource { }>; }; ForceUpdate: 0; + Networks: Array<{ + Target: string; + Aliases: string[]; + }>; }; Mode: {}; - Networks: [any[]]; }; public Endpoint!: { Spec: {}; VirtualIPs: [any[]] };