diff --git a/docs/environment-variables.md b/docs/environment-variables.md index c13d7bf3ee16..9799684660cd 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -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: diff --git a/workflow/executor/common/common.go b/workflow/executor/common/common.go index ac5d9c52bb76..18a9ecdca13a 100644 --- a/workflow/executor/common/common.go +++ b/workflow/executor/common/common.go @@ -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" @@ -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 {