Skip to content

Commit

Permalink
Pass context from Reconcile function to inside functions (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: itamar.marom <[email protected]>
  • Loading branch information
itamar-marom and itamar-marom authored Apr 19, 2023
1 parent c716a61 commit 2a5d9f5
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 67 deletions.
4 changes: 1 addition & 3 deletions controllers/druid/druid_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ func NewDruidReconciler(mgr ctrl.Manager) *DruidReconciler {
func (r *DruidReconciler) Reconcile(ctx context.Context, request reconcile.Request) (ctrl.Result, error) {
_ = r.Log.WithValues("druid", request.NamespacedName)

// your logic here

// Fetch the Druid instance
instance := &druidv1alpha1.Druid{}
err := r.Get(ctx, request.NamespacedName, instance)
Expand All @@ -74,7 +72,7 @@ func (r *DruidReconciler) Reconcile(ctx context.Context, request reconcile.Reque
// Intialize Emit Events
var emitEvent EventEmitter = EmitEventFuncs{r.Recorder}

if err := deployDruidCluster(r.Client, instance, emitEvent); err != nil {
if err := deployDruidCluster(ctx, r.Client, instance, emitEvent); err != nil {
return ctrl.Result{}, err
} else {
return ctrl.Result{RequeueAfter: r.ReconcileWait}, nil
Expand Down
Loading

0 comments on commit 2a5d9f5

Please sign in to comment.