mirror of
https://github.com/docker/compose.git
synced 2026-11-21 15:40:52 +00:00
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:
parent
9af03588ba
commit
7b52f3c3b6
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue