diff --git a/internal/command/generate.go b/internal/command/generate.go index a1d3ae6..951eedd 100644 --- a/internal/command/generate.go +++ b/internal/command/generate.go @@ -244,7 +244,7 @@ arguments. if service.DependsOn == nil { service.DependsOn = make(types.DependsOnConfig) } - service.DependsOn[waitServiceName] = types.ServiceDependency{Condition: "service_started"} + service.DependsOn[waitServiceName] = types.ServiceDependency{Condition: "service_completed_successfully", Required: true} } superProject.Services[serviceName] = service } diff --git a/internal/command/generate_test.go b/internal/command/generate_test.go index 0855188..51a6e80 100644 --- a/internal/command/generate_test.go +++ b/internal/command/generate_test.go @@ -562,8 +562,8 @@ services: compose.score.dev/workload-name: example depends_on: wait-for-resources: - condition: service_started - required: false + condition: service_completed_successfully + required: true hostname: example image: foo generic_service: @@ -663,8 +663,8 @@ services: compose.score.dev/workload-name: example depends_on: wait-for-resources: - condition: service_started - required: false + condition: service_completed_successfully + required: true hostname: example image: busybox foo-service: