Closed github-actions[bot] closed 2 years ago
https://github.com/timflannagan/rukpak/blob/17e918c63e90db8c6b2d1f0eae21c497967b196c/internal/util/util.go#L57
func MapBundleToBundleInstanceHandler(cl client.Client, log logr.Logger) handler.MapFunc { return func(object client.Object) []reconcile.Request { b, ok := object.(*rukpakv1alpha1.Bundle) if !ok { return nil } bundleInstances := &rukpakv1alpha1.BundleInstanceList{} if err := cl.List(context.Background(), bundleInstances); err != nil { log.WithName("mapBundleToBundleInstanceHandler").Error(err, "list bundles") return nil } var requests []reconcile.Request for _, bi := range bundleInstances.Items { bi := bi // TODO: compare owner references vs. spec.Selector label selectors? for _, ref := range b.GetOwnerReferences() { if ref.Name == bi.GetName() { requests = append(requests, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&bi)}) } } } return requests
Closed in 7bbdbf12679aff744ff6501e2ce7fcbf829b737c
https://github.com/timflannagan/rukpak/blob/17e918c63e90db8c6b2d1f0eae21c497967b196c/internal/util/util.go#L57