Skip to content

Commit

Permalink
Add provider connection options BMCOptions:
Browse files Browse the repository at this point in the history
This propogates all options appropriately.
This fixes an issue where no options except
RPC options get passed through properly.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
  • Loading branch information
jacobweinstock committed Jan 8, 2024
1 parent 3fbc452 commit 13c5f05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion controller/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion controller/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 13c5f05

Please sign in to comment.