Skip to content

Commit

Permalink
fix: controller option to not watch configmap (#12622)
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Quadri <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Co-authored-by: Anton Gilgur <[email protected]>
Signed-off-by: Isitha Subasinghe <[email protected]>
  • Loading branch information
2 people authored and isubasinghe committed Feb 28, 2024
1 parent a5bf996 commit 901cfb6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ ClusterRoleBinding
CRD
CRDs
CloudSQL
ClusterRoleBinding
ClusterRoles
Codespaces
ConfigMap
ConfigMaps
Couler
CronWorkflow
CronWorkflows
DataDog
Dataflow
DeleteObject
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 @@ most users. Environment variables may be removed at any time.
| `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_CONTROLLER_SEMAPHORE_CONFIGMAPS` | `bool` | `true` | Whether to watch the Controller's ConfigMap and semaphore ConfigMaps for run-time changes. When disabled, the Controller will only read these ConfigMaps once and will have to be manually restarted to pick up new changes. |

CLI parameters of the `argo-server` and `workflow-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"
gosync "sync"
"syscall"
Expand Down Expand Up @@ -299,7 +300,10 @@ func (wfc *WorkflowController) Run(ctx context.Context, wfWorkers, workflowTTLWo
log.Fatal(err)
}

go wfc.runConfigMapWatcher(ctx.Done())
if os.Getenv("WATCH_CONTROLLER_SEMAPHORE_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 901cfb6

Please sign in to comment.