Skip to content

Commit

Permalink
fix: controller option to not watch configmap
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Quadri <paolo.quadri@remote.com>
  • Loading branch information
pquadri committed Feb 5, 2024
1 parent e771bde commit 05e5c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ CloudSQL
ClusterRoleBinding
ClusterRoles
Codespaces
ConfigMap
ConfigMaps
Couler
CronWorkflow
CronWorkflows
Expand Down
1 change: 1 addition & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ This document outlines environment variables that can be used to customize behav
| `WF_DEL_PROPAGATION_POLICY` | `string` | `""` | The deletion propagation policy for workflows. |
| `WORKFLOW_GC_PERIOD` | `time.Duration` | `5m` | The periodicity for GC of workflows. |
| `SEMAPHORE_NOTIFY_DELAY` | `time.Duration` | `1s` | Tuning Delay when notifying semaphore waiters about availability in the semaphore |
| `WATCH_CONFIGMAPS` | `bool` | `true` | Whether to watch the Controller's ConfigMap and semaphore ConfigMaps for run-time changes. When disabled, the Controller will only read ConfigMaps once and will have to be manually restarted to pick up new changes. |

CLI parameters of the Controller can be specified as environment variables with the `ARGO_` prefix.
For example:
Expand Down
6 changes: 5 additions & 1 deletion workflow/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"strconv"
"strings"
gosync "sync"
Expand Down Expand Up @@ -308,7 +309,10 @@ func (wfc *WorkflowController) Run(ctx context.Context, wfWorkers, workflowTTLWo
log.Fatal(err)
}

go wfc.runConfigMapWatcher(ctx.Done())
if os.Getenv("WATCH_CONFIGMAPS") != "false" {
go wfc.runConfigMapWatcher(ctx.Done())
}

go wfc.wfInformer.Run(ctx.Done())
go wfc.wftmplInformer.Informer().Run(ctx.Done())
go wfc.podInformer.Run(ctx.Done())
Expand Down

0 comments on commit 05e5c36

Please sign in to comment.