mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
projectOrName falls back to a label-driven, file-less project on any load failure when COMPOSE_PROJECT_NAME is set -- swallowing the load error entirely, including "no such service" for a target that's actually a declared job. Since that branch returns err == nil, jobTargetErr (gated on err != nil) and rejectScheduledJobs (gated on project != nil) were both skipped: `docker compose start migrate` fell through to a label-driven start that finds no container for a job that was never run, and exited 0 having silently done nothing. Refuse a named job explicitly on that fallback path too, reusing unselectedJobs from the previous commit. Also adds the test coverage this and the previous fix (job-target error messages on create/start) were entirely missing: create.go and start.go had no unit tests at all, and pkg/e2e/jobs_test.go only exercised up/run. Signed-off-by: Nicolas De Loof <[email protected]>