Skip to content

Commit

Permalink
Merge pull request #16 from flanksource/feat/update-status-support
Browse files Browse the repository at this point in the history
feat: support updating status subresource
  • Loading branch information
moshloop authored Jun 4, 2024
2 parents 7e7519a + a7fe11f commit 6417cf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ func (r *Reconciler[T, PT]) Reconcile(ctx gocontext.Context, req ctrl.Request) (
return ctrl.Result{Requeue: true, RequeueAfter: 2 * time.Minute}, err
}

if err := r.Status().Update(r.DutyContext, obj); err != nil {
logger.Errorf("[kopper] failed to update status %s: %v", resourceName, err)
return ctrl.Result{Requeue: true, RequeueAfter: 2 * time.Minute}, err
}

logger.Infof("[kopper] upserted %s", resourceName)
return ctrl.Result{}, nil

Expand Down

0 comments on commit 6417cf7

Please sign in to comment.