From eedf9131b4e18339b72c67e2ace386bd4a4ca83e Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 21 Sep 2026 11:54:09 +0200 Subject: [PATCH] fix(run): stop double-warning unsupported attributes on the job fallback The fallback reload runProject uses to detect a job target passed warnUnsupportedAttributes, the same option as the first, selective load right before it -- which had already fired every warning once. For the common case where the target is neither a service nor a job (a plain typo), every finding got logged twice before falling through to the original, correct error anyway. skipUnsupportedAttributesWarning already exists for exactly this secondary-load case (see its other call sites in compose.go and completion.go); use it here too. Signed-off-by: Nicolas De Loof --- cmd/compose/run.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/compose/run.go b/cmd/compose/run.go index 3d89d2737..aba0acea8 100644 --- a/cmd/compose/run.go +++ b/cmd/compose/run.go @@ -291,8 +291,10 @@ func runProject(ctx context.Context, dockerCli command.Cli, backend api.Compose, // it, so the env resolution below sees the job like any selected // service (its env_file resolves; unrelated services' env_file still // doesn't need to exist). A target that is not a declared job keeps - // the original, precise selection error. - unselected, _, uerr := p.ToProject(ctx, dockerCli, backend, nil, warnUnsupportedAttributes, composecli.WithoutEnvironmentResolution) + // the original, precise selection error. The first load above already + // warned about unsupported attributes; skip it here so a target that + // turns out to be a plain typo doesn't get the same warnings twice. + unselected, _, uerr := p.ToProject(ctx, dockerCli, backend, nil, skipUnsupportedAttributesWarning, composecli.WithoutEnvironmentResolution) if uerr != nil { return nil, err }