Skip to content

Commit

Permalink
fix(executor): Fixed waitMainContainerStart returning prematurely. Cl…
Browse files Browse the repository at this point in the history
…oses #4599 (#4601)

Signed-off-by: fsiegmund <siegmund@slb.com>
  • Loading branch information
fsiegmund authored Nov 30, 2020
1 parent b92d889 commit 5c538d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Currently, the following organizations are **officially** using Argo Workflows:
1. [SAP Fieldglass](https://www.fieldglass.com/)
1. [SAP Hybris](https://cx.sap.com/)
1. [SAS](https://www.sas.com/)
1. [Schlumberger](https://slb.com/)
1. [SegmentStream](https://segmentstream.com)
1. [Sidecar Technologies](https://hello.getsidecar.com/)
1. [Sohu](https://www.sohu.com/)
Expand Down
10 changes: 5 additions & 5 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1082,13 +1082,13 @@ func (we *WorkflowExecutor) waitMainContainerStart() (string, error) {
for _, ctrStatus := range pod.Status.ContainerStatuses {
if ctrStatus.Name == common.MainContainerName {
log.Debug(ctrStatus)
if ctrStatus.ContainerID != "" {
we.mainContainerID = containerID(ctrStatus.ContainerID)
return containerID(ctrStatus.ContainerID), nil
if ctrStatus.State.Waiting != nil {
// main container is still in waiting status
} else if ctrStatus.State.Waiting == nil && ctrStatus.State.Running == nil && ctrStatus.State.Terminated == nil {
// status still not ready, wait
} else if ctrStatus.State.Waiting != nil {
// main container is still in waiting status
} else if ctrStatus.ContainerID != "" {
we.mainContainerID = containerID(ctrStatus.ContainerID)
return containerID(ctrStatus.ContainerID), nil
} else {
// main container in running or terminated state but missing container ID
return "", errors.InternalError("Main container ID cannot be found")
Expand Down

0 comments on commit 5c538d7

Please sign in to comment.