Skip to content

Commit

Permalink
Add two optimization TODOs for EnqueueForCompositionRevision
Browse files Browse the repository at this point in the history
Signed-off-by: Nic Cope <nicc@rk0n.org>
  • Loading branch information
negz committed May 17, 2024
1 parent 6b0d991 commit a8da7ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controller/apiextensions/definition/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func EnqueueForCompositionRevision(of resource.CompositeKind, c client.Reader, l
xrs := kunstructured.UnstructuredList{}
xrs.SetGroupVersionKind(schema.GroupVersionKind(of))
xrs.SetKind(schema.GroupVersionKind(of).Kind + "List")
// TODO(negz): Index XRs by composition revision name?
if err := c.List(ctx, &xrs); err != nil {
// logging is most we can do here. This is a programming error if it happens.
log.Info("cannot list in CompositionRevision handler", "type", schema.GroupVersionKind(of).String(), "error", err)
Expand All @@ -62,6 +63,7 @@ func EnqueueForCompositionRevision(of resource.CompositeKind, c client.Reader, l

// enqueue all those that reference the Composition of this revision
compName := rev.Labels[v1.LabelCompositionName]
// TODO(negz): Check this before we get all XRs.
if compName == "" {
return
}
Expand Down

0 comments on commit a8da7ab

Please sign in to comment.