Skip to content

Commit d647116

Browse files
committed
Add AddWithActuatorOpts to allow overriding Machine controller options
1 parent 8d8b7e5 commit d647116

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/controller/machine/controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,17 @@ const (
7676
var DefaultActuator Actuator
7777

7878
func AddWithActuator(mgr manager.Manager, actuator Actuator) error {
79-
if err := add(mgr, newReconciler(mgr, actuator), "machine-controller"); err != nil {
79+
return AddWithActuatorOpts(mgr, actuator, controller.Options{})
80+
}
81+
82+
func AddWithActuatorOpts(mgr manager.Manager, actuator Actuator, opts controller.Options) error {
83+
machineControllerOpts := opts
84+
machineControllerOpts.Reconciler = newReconciler(mgr, actuator)
85+
86+
if err := addWithOpts(mgr, machineControllerOpts, "machine-controller"); err != nil {
8087
return err
8188
}
89+
8290
if err := addWithOpts(mgr, controller.Options{
8391
Reconciler: newDrainController(mgr),
8492
RateLimiter: newDrainRateLimiter(),

0 commit comments

Comments
 (0)