Merge pull request #5024 from laurazard/run-hooks-error

plugins/hooks: run hooks when exit code != 0
This commit is contained in:
Laura Brehm 2024-04-18 01:05:52 +01:00 committed by GitHub
commit 78089c5394
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -353,9 +353,6 @@ func runDocker(ctx context.Context, dockerCli *command.DockerCli) error {
// which remain. // which remain.
cmd.SetArgs(args) cmd.SetArgs(args)
err = cmd.Execute() err = cmd.Execute()
if err != nil {
return err
}
// If the command is being executed in an interactive terminal, // If the command is being executed in an interactive terminal,
// run the plugin hooks (but don't throw an error if something misbehaves) // run the plugin hooks (but don't throw an error if something misbehaves)
@ -363,7 +360,7 @@ func runDocker(ctx context.Context, dockerCli *command.DockerCli) error {
_ = pluginmanager.RunPluginHooks(dockerCli, cmd, subCommand, "", args) _ = pluginmanager.RunPluginHooks(dockerCli, cmd, subCommand, "", args)
} }
return nil return err
} }
type versionDetails interface { type versionDetails interface {