Skip to content

Commit

Permalink
feat(executor): Configurable interval for wait container to check con…
Browse files Browse the repository at this point in the history
…tainer statuses. Fixes #5943 (#6088)
  • Loading branch information
terrytangyuan authored Jun 4, 2021
1 parent c111b42 commit 937bbb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ spec:
| `PNS_PRIVILEGED` | `bool` | `false` | Whether to always set privileged on for PNS when PNS executor is used. |
| `REMOVE_LOCAL_ART_PATH` | `bool` | `false` | Whether to remove local artifacts. |
| `RESOURCE_STATE_CHECK_INTERVAL` | `time.Duration` | `5s` | The time interval between resource status checks against the specified success and failure conditions. |
| `WAIT_CONTAINER_STATUS_CHECK_INTERVAL` | `time.Duration` | `5s` | The time interval for wait container to check whether the containers have completed. |

You can set the environment variables for executor by customizing executor container's environment variables in your
controller's configmap like the following:
Expand Down
4 changes: 3 additions & 1 deletion workflow/executor/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"syscall"
"time"

envutil "github.com/argoproj/argo-workflows/v3/util/env"

log "github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"

Expand Down Expand Up @@ -38,7 +40,7 @@ type KubernetesClientInterface interface {

// WaitForTermination of the given containerName, set the timeout to 0 to discard it
func WaitForTermination(ctx context.Context, c KubernetesClientInterface, containerNames []string, timeout time.Duration) error {
ticker := time.NewTicker(time.Second * 5)
ticker := time.NewTicker(envutil.LookupEnvDurationOr("WAIT_CONTAINER_STATUS_CHECK_INTERVAL", time.Second*5))
defer ticker.Stop()
timer := time.NewTimer(timeout)
if timeout == 0 {
Expand Down

0 comments on commit 937bbb9

Please sign in to comment.