mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: support compose stop_grace_period to change timeout before sending SIGKILL
This commit is contained in:
@@ -85,6 +85,11 @@ func ServiceSpecFromCompose(project *types.Project, serviceName string) (api.Ser
|
||||
}
|
||||
}
|
||||
|
||||
if service.StopGracePeriod != nil {
|
||||
d := time.Duration(*service.StopGracePeriod)
|
||||
spec.StopGracePeriod = &d
|
||||
}
|
||||
|
||||
if service.Scale != nil {
|
||||
spec.Replicas = uint(*service.Scale)
|
||||
}
|
||||
|
||||
@@ -205,7 +205,8 @@ func TestServiceSpecFromCompose(t *testing.T) {
|
||||
Placement: api.Placement{
|
||||
Machines: []string{"machine-1", "machine-2"},
|
||||
},
|
||||
Replicas: 3,
|
||||
Replicas: 3,
|
||||
StopGracePeriod: api.AsPtr(30 * time.Second),
|
||||
UpdateConfig: api.UpdateConfig{
|
||||
Order: api.UpdateOrderStopFirst,
|
||||
MonitorPeriod: &api.DefaultHealthMonitorPeriod,
|
||||
|
||||
@@ -37,6 +37,7 @@ services:
|
||||
privileged: true
|
||||
pull_policy: always
|
||||
scale: 3
|
||||
stop_grace_period: 30s
|
||||
sysctls:
|
||||
- net.ipv4.ip_forward=1
|
||||
ulimits:
|
||||
|
||||
Reference in New Issue
Block a user