Skip to content

Commit a42cf2b

Browse files
committed
Change health_check and stop_grace_period schema from int32 to float64
Docker API expects nanosecond durations (int64). JTD has no int64 type, so float64 is used instead. int32 overflows at ~2.1s which is too small for any practical health check interval.
1 parent 17a72aa commit a42cf2b

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
]
7676
},
7777
"stop_grace_period": {
78-
"type": "int32"
78+
"type": "float64"
7979
},
8080
"user": {
8181
"type": "string"
@@ -140,19 +140,19 @@
140140
}
141141
},
142142
"interval": {
143-
"type": "int32"
143+
"type": "float64"
144144
},
145145
"timeout": {
146-
"type": "int32"
146+
"type": "float64"
147147
},
148148
"retries": {
149149
"type": "int32"
150150
},
151151
"start_period": {
152-
"type": "int32"
152+
"type": "float64"
153153
},
154154
"start_interval": {
155-
"type": "int32"
155+
"type": "float64"
156156
}
157157
}
158158
},

src/swarm-app-config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const swarmAppConfigSchema: JTDSchemaType<SwarmAppConfig> = {
104104
},
105105
replicas: {type: "int32"},
106106
stop_signal: {enum: ["SIGTERM", "SIGQUIT"]},
107-
stop_grace_period: {type: "int32"},
107+
stop_grace_period: {type: "float64"},
108108
user: {type: "string"},
109109
placement: {
110110
optionalProperties: {
@@ -138,11 +138,11 @@ export const swarmAppConfigSchema: JTDSchemaType<SwarmAppConfig> = {
138138
health_check: {
139139
optionalProperties: {
140140
test: {elements: {type: "string"}},
141-
interval: {type: "int32"},
142-
timeout: {type: "int32"},
141+
interval: {type: "float64"},
142+
timeout: {type: "float64"},
143143
retries: {type: "int32"},
144-
start_period: {type: "int32"},
145-
start_interval: {type: "int32"},
144+
start_period: {type: "float64"},
145+
start_interval: {type: "float64"},
146146
},
147147
},
148148
dir: {type: "string"},

0 commit comments

Comments
 (0)