Skip to content

Commit

Permalink
set owner reference on logger pod (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakito authored Dec 24, 2022
1 parent e0afb6c commit c593491
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/setup/eventlogger_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu

// Define a new Pod object
pod := r.podForCR(cr)

// set owner reference for pod
if err := controllerutil.SetOwnerReference(cr, pod, r.Scheme); err != nil {
return r.updateCR(ctx, cr, reqLogger, err)
}

// Check if this Pod already exists
podChanged, err := r.createOrReplacePod(ctx, cr, pod, reqLogger)
if err != nil {
Expand Down

0 comments on commit c593491

Please sign in to comment.