Skip to content

Commit

Permalink
feature/367 fix: skip container if pre-update command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
simskij authored and Simon Aronsson committed Mar 28, 2020
1 parent fac26df commit c1a0da9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/actions/update.go
Expand Up @@ -74,9 +74,13 @@ func stopStaleContainer(container container.Container, client container.Client,
return
}
if params.LifecycleHooks {
lifecycle.ExecutePreUpdateCommand(client, container)
if err := lifecycle.ExecutePreUpdateCommand(client, container); err != nil {
log.Error(err)
log.Info("Skipping container as the pre-update command failed")
return
}
}

if err := client.StopContainer(container, params.Timeout); err != nil {
log.Error(err)
}
Expand Down Expand Up @@ -139,4 +143,4 @@ func checkDependencies(containers []container.Container) {
}
}
}
}
}

0 comments on commit c1a0da9

Please sign in to comment.