Post update time out (#1124)

* adding post update timeout option

* removing extra word
This commit is contained in:
Patrice 2021-11-18 05:54:35 -08:00 committed by GitHub
parent 782529ddbd
commit b4a225c8bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 4 deletions

View file

@ -83,6 +83,7 @@ func ExecutePreUpdateCommand(client container.Client, container container.Contai
// ExecutePostUpdateCommand tries to run the post-update lifecycle hook for a single container.
func ExecutePostUpdateCommand(client container.Client, newContainerID types.ContainerID) {
newContainer, err := client.GetContainer(newContainerID)
timeout := newContainer.PostUpdateTimeout()
if err != nil {
log.WithField("containerID", newContainerID.ShortID()).Error(err)
@ -97,7 +98,7 @@ func ExecutePostUpdateCommand(client container.Client, newContainerID types.Cont
}
clog.Debug("Executing post-update command.")
_, err = client.ExecuteCommand(newContainerID, command, 1)
_, err = client.ExecuteCommand(newContainerID, command, timeout)
if err != nil {
clog.Error(err)