Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a reverse index of a CRDs resources #88

Open
coryodaniel opened this issue Feb 17, 2020 · 3 comments
Open

Add a reverse index of a CRDs resources #88

coryodaniel opened this issue Feb 17, 2020 · 3 comments

Comments

@coryodaniel
Copy link
Owner

coryodaniel commented Feb 17, 2020

metadata.ownerReferences isn't a field that can be queried w/ field selectors, so to get all the items created by a CRD it would required polling all kinds/all resources which sucks.

The 'reverse index' or 'inventory' would include track all the resources created by this CRD. inspiration

spec:
  resources:
  - selfLink: "/v1/pods/namespace/default/foo"
  # or
  - name: foo
     namespace: default
     kind: Pod
     apiVersion: v1

This could be useful for looking up resources, not necessary for bonny itself, but it could be a nice helper for a controller that needed to find resources that it created.

This won't be needed for deletion once #49 is implemented, as garbage collection will be handled by k8s.

@sleipnir
Copy link
Contributor

This still relevant ?

@mruoss
Copy link
Collaborator

mruoss commented Feb 24, 2023

What do you mean by "relevant"? There is no code in Bonny to manage a reverse index on the parent resource. It is relevant if people need it, right?
But also, I don't see a simple solution to maintain such a reverse index. If a descendant is deleted, we'd need to update also the parent...
A field selector would be nice but as far as I know, the only fields on CRDs which can be querried by field selectors are name and namespace. So no support there...

@sleipnir
Copy link
Contributor

Yes it is relevant if people need it. But did anyone need it? It's just my curiosity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants