Skip to content

Commit

Permalink
Merge pull request #1214 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1209-to-release-4.14

[release-4.14] OCPBUGS-28745: Add AddWithActuatorOpts to allow overriding Machine controller options
  • Loading branch information
openshift-merge-bot[bot] committed Feb 5, 2024
2 parents a1855dc + 6c13ecb commit 4390dd7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/controller/machine/controller.go
Expand Up @@ -76,9 +76,17 @@ const (
var DefaultActuator Actuator

func AddWithActuator(mgr manager.Manager, actuator Actuator) error {
if err := add(mgr, newReconciler(mgr, actuator), "machine-controller"); err != nil {
return AddWithActuatorOpts(mgr, actuator, controller.Options{})
}

func AddWithActuatorOpts(mgr manager.Manager, actuator Actuator, opts controller.Options) error {
machineControllerOpts := opts
machineControllerOpts.Reconciler = newReconciler(mgr, actuator)

if err := addWithOpts(mgr, machineControllerOpts, "machine-controller"); err != nil {
return err
}

if err := addWithOpts(mgr, controller.Options{
Reconciler: newDrainController(mgr),
RateLimiter: newDrainRateLimiter(),
Expand Down

0 comments on commit 4390dd7

Please sign in to comment.