Skip to content

Commit

Permalink
fixed #127 (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelespazzoli authored Feb 24, 2023
1 parent becb424 commit c56bae0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions controllers/databasesecretenginestaticrole_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,14 @@ func (r *DatabaseSecretEngineStaticRoleReconciler) Reconcile(ctx context.Context
return reconcile.Result{}, err
}

ctx = context.WithValue(ctx, "kubeClient", r.GetClient())
ctx = context.WithValue(ctx, "restConfig", r.GetRestConfig())
vaultClient, err := instance.Spec.Authentication.GetVaultClient(ctx, instance.Namespace)
ctx1, err := prepareContext(ctx, r.ReconcilerBase, instance)
if err != nil {
r.Log.Error(err, "unable to create vault client", "instance", instance)
r.Log.Error(err, "unable to prepare context", "instance", instance)
return vaultresourcecontroller.ManageOutcome(ctx, r.ReconcilerBase, instance, err)
}
ctx = context.WithValue(ctx, "vaultClient", vaultClient)
vaultResource := vaultresourcecontroller.NewVaultResource(&r.ReconcilerBase, instance)

return vaultResource.Reconcile(ctx, instance)
return vaultResource.Reconcile(ctx1, instance)
}

// SetupWithManager sets up the controller with the Manager.
Expand Down

0 comments on commit c56bae0

Please sign in to comment.