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 b0614c5..b46d92a 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"}, }, }, },