fix(dry-run): log skipped hooks at debug level

Hooks are skipped silently under --dry-run. Log each skipped hook at
debug level so --verbose shows which one would have run.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2026-11-16 12:27:30 +01:00 • committed by Guillaume Lours
parent 9af03588ba
commit 7b52f3c3b6

View file

@ -27,6 +27,7 @@ import (
"github.com/moby/moby/api/pkg/stdcopy"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/client"
"github.com/sirupsen/logrus"
"github.com/docker/compose/v5/internal/naming"
"github.com/docker/compose/v5/pkg/api"
@ -44,6 +45,7 @@ func (s *composeService) runHook(ctx context.Context, ctr container.Summary, ser
// A dry-run must have no side effects, and the dry-run client cannot
// attach to an exec: skip the hook rather than fail on it.
if s.dryRun {
logrus.Debugf("dry-run: skipping hook %v of service %s", hook.Command, service.Name)
return nil
}