Skip to content

Commit

Permalink
Added explanatory note about the index
Browse files Browse the repository at this point in the history
  • Loading branch information
toonsevrin committed Mar 11, 2020
1 parent 05e5d70 commit 8b726b0
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ func (r *CronJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}

/*
<aside class="note">
<h1>What is this index about?</h1>
<p>The reconciler fetches all jobs owned by the cronjob for the status. As our number of cronjobs increases,
looking these up can become quite slow as we have to filter through all of them. For a more efficient lookup,
these jobs will be indexed locally on the controller's name. A jobOwnerKey field is added to the
cached job objects. This key references the owning controller and functions as the index. Later in this
document we will configure the manager to actually index this field.</p>
</aside>
Once we have all the jobs we own, we'll split them into active, successful,
and failed jobs, keeping track of the most recent run so that we can record it
in status. Remember, status should be able to be reconstituted from the state
Expand Down

0 comments on commit 8b726b0

Please sign in to comment.