refactor: move StopGracePeriod from ServiceSpec to ContainerSpec

This commit is contained in:
Pasha Sviderski
2026-03-24 18:41:01 +10:00
parent ada9bec2d4
commit 30bcb021d2
4 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ func ServiceSpecFromCompose(project *types.Project, serviceName string) (api.Ser
if service.StopGracePeriod != nil {
d := time.Duration(*service.StopGracePeriod)
spec.StopGracePeriod = &d
spec.Container.StopGracePeriod = &d
}
if service.Scale != nil {
+2 -2
View File
@@ -147,6 +147,7 @@ func TestServiceSpecFromCompose(t *testing.T) {
{Count: -1, Capabilities: [][]string{{"gpu"}}},
},
},
StopGracePeriod: new(30 * time.Second),
Sysctls: map[string]string{
"net.ipv4.ip_forward": "1",
},
@@ -207,8 +208,7 @@ func TestServiceSpecFromCompose(t *testing.T) {
Placement: api.Placement{
Machines: []string{"machine-1", "machine-2"},
},
Replicas: 3,
StopGracePeriod: api.AsPtr(30 * time.Second),
Replicas: 3,
UpdateConfig: api.UpdateConfig{
Order: api.UpdateOrderStopFirst,
MonitorPeriod: &api.DefaultHealthMonitorPeriod,