From 2c9bec52e89c308545084b6674193dc876005aa2 Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Sun, 10 May 2026 10:28:50 +0200 Subject: [PATCH] Fix YAML schema inconsistencies - examples: stop_grace_period was 10 (= 10ns); change to 10000000000 with "10s (nanoseconds)" comment to match the convention #109 established for health_check durations. - mounts.readonly -> mounts.read_only for snake_case consistency with the rest of the schema and Docker Compose. BREAKING. - Configs File.Mode 0 -> 0o444 to match Docker Compose's default for config file permissions. --- examples/swarm-app.yml | 4 ++-- schema.json | 2 +- src/service-spec.ts | 4 ++-- src/swarm-app-config.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/swarm-app.yml b/examples/swarm-app.yml index f594234..1ac5f33 100644 --- a/examples/swarm-app.yml +++ b/examples/swarm-app.yml @@ -46,7 +46,7 @@ service_specs: - shared replicas: 2 stop_signal: SIGQUIT - stop_grace_period: 10 + stop_grace_period: 10000000000 # 10s (nanoseconds) user: '0' dir: /etc/nginx placement: @@ -72,4 +72,4 @@ service_specs: /etc/nginx/: source: "web-data" type: "volume" # "bind|volume" - readonly: true + read_only: true diff --git a/schema.json b/schema.json index 50d5a21..c362f17 100644 --- a/schema.json +++ b/schema.json @@ -171,7 +171,7 @@ "bind" ] }, - "readonly": { + "read_only": { "type": "boolean" } } diff --git a/src/service-spec.ts b/src/service-spec.ts index 0793626..4fc1abd 100644 --- a/src/service-spec.ts +++ b/src/service-spec.ts @@ -47,7 +47,7 @@ export function initServiceSpec ({appName, serviceName, config, hashedConfigs, c if (byServiceName.length > 0) { configs = byServiceName.map(({targetPath, hash}) => { return { - File: {Name: targetPath, UID: "0", GID: "0", Mode: 0}, + File: {Name: targetPath, UID: "0", GID: "0", Mode: 0o444}, ConfigID: current?.configs.find((c) => c.Spec?.Name === hash)?.ID, ConfigName: hash, }; @@ -94,7 +94,7 @@ export function initServiceSpec ({appName, serviceName, config, hashedConfigs, c Target: t, Source: m.source, Type: m.type, - ReadOnly: m.readonly, + ReadOnly: m.read_only, }; }), }, diff --git a/src/swarm-app-config.ts b/src/swarm-app-config.ts index 2a16db0..da44021 100644 --- a/src/swarm-app-config.ts +++ b/src/swarm-app-config.ts @@ -57,7 +57,7 @@ export interface SwarmAppServiceConfig { mounts?: Record; update_config?: { parallelism: number; @@ -151,7 +151,7 @@ export const swarmAppConfigSchema: JTDSchemaType = { properties: { source: {type: "string"}, type: {enum: ["volume", "bind"]}, - readonly: {type: "boolean"}, + read_only: {type: "boolean"}, }, }, },