mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat: add support for healthcheck in Compose
This commit is contained in:
@@ -1315,6 +1315,7 @@ func TestServiceLifecycle(t *testing.T) {
|
||||
Name: "container-spec-full",
|
||||
Mode: api.ServiceModeGlobal,
|
||||
Container: api.ContainerSpec{
|
||||
// TODO: Add the latest implemented fields to this spec and update assertContainerMatchesSpec.
|
||||
Command: []string{"sleep", "infinity"},
|
||||
// Extra slashes is not a typo, it changes the spec but Linux ignores them and uses the default /pause.
|
||||
Entrypoint: []string{"///pause"},
|
||||
@@ -1324,6 +1325,14 @@ func TestServiceLifecycle(t *testing.T) {
|
||||
"BOOL": "true",
|
||||
"": "ignored",
|
||||
},
|
||||
Healthcheck: &api.HealthcheckSpec{
|
||||
Test: []string{"CMD-SHELL", "exit 0"},
|
||||
Interval: 1*time.Minute + 30*time.Second,
|
||||
Timeout: 10 * time.Second,
|
||||
Retries: 5,
|
||||
StartPeriod: 15 * time.Second,
|
||||
StartInterval: 2 * time.Second,
|
||||
},
|
||||
Image: "portainer/pause:latest",
|
||||
Init: &init,
|
||||
LogDriver: &api.LogDriver{
|
||||
|
||||
Reference in New Issue
Block a user