Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass context from Reconcile function to inside functions #44

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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