From 13c5f05bd556cdc00288e59fe9eef9ccac1f8939 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 8 Jan 2024 13:11:15 -0700 Subject: [PATCH] Add provider connection options BMCOptions: This propogates all options appropriately. This fixes an issue where no options except RPC options get passed through properly. Signed-off-by: Jacob Weinstock --- controller/machine.go | 4 +++- controller/task.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/controller/machine.go b/controller/machine.go index e01ac8e..3ebb322 100644 --- a/controller/machine.go +++ b/controller/machine.go @@ -93,7 +93,9 @@ func (r *MachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct func (r *MachineReconciler) doReconcile(ctx context.Context, bm *v1alpha1.Machine, bmPatch client.Patch, logger logr.Logger) (ctrl.Result, error) { var username, password string - opts := &BMCOptions{} + opts := &BMCOptions{ + ProviderOptions: bm.Spec.Connection.ProviderOptions, + } if bm.Spec.Connection.ProviderOptions != nil && bm.Spec.Connection.ProviderOptions.RPC != nil { opts.ProviderOptions = bm.Spec.Connection.ProviderOptions if len(bm.Spec.Connection.ProviderOptions.RPC.HMAC.Secrets) > 0 { diff --git a/controller/task.go b/controller/task.go index 9b31459..1ce79fe 100644 --- a/controller/task.go +++ b/controller/task.go @@ -88,7 +88,9 @@ func (r *TaskReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. func (r *TaskReconciler) doReconcile(ctx context.Context, task *v1alpha1.Task, taskPatch client.Patch, logger logr.Logger) (ctrl.Result, error) { var username, password string - opts := &BMCOptions{} + opts := &BMCOptions{ + ProviderOptions: task.Spec.Connection.ProviderOptions, + } if task.Spec.Connection.ProviderOptions != nil && task.Spec.Connection.ProviderOptions.RPC != nil { opts.ProviderOptions = task.Spec.Connection.ProviderOptions if len(task.Spec.Connection.ProviderOptions.RPC.HMAC.Secrets) > 0 {