diff --git a/playground/local_runner.go b/playground/local_runner.go index a08400e..b67c1c2 100644 --- a/playground/local_runner.go +++ b/playground/local_runner.go @@ -568,6 +568,10 @@ func (d *LocalRunner) toDockerComposeService(s *Service) (map[string]interface{} } } + if s.UngracefulShutdown { + service["stop_grace_period"] = "0s" + } + if s.DependsOn != nil { depends := map[string]interface{}{} diff --git a/playground/manifest.go b/playground/manifest.go index 93054b5..fcad0fe 100644 --- a/playground/manifest.go +++ b/playground/manifest.go @@ -201,7 +201,8 @@ func (s *Manifest) Validate() error { WithImage("alpine/curl"). WithTag("latest"). WithArgs("sleep", "infinity"). - WithReady(readyCheck) + WithReady(readyCheck). + WithUngracefulShutdown() } // validate node port references @@ -330,6 +331,8 @@ type Service struct { Entrypoint string `json:"entrypoint,omitempty"` HostPath string `json:"host_path,omitempty"` + UngracefulShutdown bool `json:"ungraceful_shutdown,omitempty"` + release *release } @@ -491,6 +494,11 @@ type ReadyCheck struct { Retries int `json:"retries"` } +func (s *Service) WithUngracefulShutdown() *Service { + s.UngracefulShutdown = true + return s +} + func (s *Service) DependsOnHealthy(name string) *Service { s.DependsOn = append(s.DependsOn, &DependsOn{Name: name, Condition: DependsOnConditionHealthy}) return s