Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
- --global-backend-config-namespace={{ .Values.controllerManager.globalBackendConfigNamespace }}
- --namespaced-backend-config={{ .Values.controllerManager.namespacedBackendConfig }}
- --add-default-affinity={{ .Values.controllerManager.addDefaultAffinity }}
- --pause-rollout={{ .Values.controllerManager.pauseRollout }}
env:
- name: NAMESPACE
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions charts/function-mesh-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ controllerManager:
globalBackendConfigNamespace: default
namespacedBackendConfig: backend-config
addDefaultAffinity: true
pauseRollout: false

admissionWebhook:
enabled: true
1 change: 1 addition & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
- "--namespaced-backend-config=backend-config"
- "--global-backend-config=global-backend-config"
- "--global-backend-config-namespace=sn-system"
- "--pause-rollout=false"
ports:
- containerPort: 8443
name: metrics
Expand Down
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
- --namespaced-backend-config=backend-config
- --global-backend-config=global-backend-config
- --global-backend-config-namespace=sn-system
- --pause-rollout=false
image: controller:latest
name: manager
resources:
Expand Down
5 changes: 5 additions & 0 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ func IsManaged(object metav1.Object) bool {
}

func IsPauseRollout(object metav1.Object) bool {
// the global flag
if utils.PauseRollout {
return true
}
// the annotation flag per object
pauseRollout, exists := object.GetAnnotations()[AnnotationPauseRollout]
return exists && pauseRollout == "true"
}
Comment thread
jiangpengcheng marked this conversation as resolved.
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func main() {
var namespacedBackendConfig string
var secureMetrics bool
var addDefaultAffinity bool
var pauseRollout bool
flag.StringVar(&metricsAddr, "metrics-addr", lookupEnvOrString("METRICS_ADDR", ":8443"),
"The address the metric endpoint binds to.")
flag.StringVar(&leaderElectionID, "leader-election-id",
Expand Down Expand Up @@ -115,6 +116,7 @@ func main() {
" Use --metrics-secure=false to use HTTP instead.")
flag.BoolVar(&addDefaultAffinity, "add-default-affinity", lookupEnvOrBool("ADD_DEFAULT_AFFINITY", true), "If set, the generated pod will add one default podAntiAffinity:"+
" make pods prefer not be scheduled on the same node (soft rule).")
flag.BoolVar(&pauseRollout, "pause-rollout", lookupEnvOrBool("PAUSE_ROLLOUT", false), "If set, the controller will not rollout the function/sink/source when its spec is not updated.")
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
Expand All @@ -123,6 +125,7 @@ func main() {
utils.GlobalBackendConfigNamespace = globalBackendConfigNamespace
utils.NamespacedBackendConfig = namespacedBackendConfig
utils.AddDefaultAffinity = addDefaultAffinity
utils.PauseRollout = pauseRollout

// enable pprof
if enablePprof {
Expand Down
1 change: 1 addition & 0 deletions utils/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ var GlobalBackendConfig = ""
var GlobalBackendConfigNamespace = "default"
var NamespacedBackendConfig = ""
var AddDefaultAffinity = true
var PauseRollout = false
Loading