-
Notifications
You must be signed in to change notification settings - Fork 218
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 "OwnerType" Annotation for Non-GC'ed DependentResources #2585
Comments
I need to double check but isn't the type of the primary known when the annotations are used? |
Indeed, the owner type is not known. However, this will require deeper changes than simply adding the annotation because the mappers only return |
@metacosm I'm pretty sure we don't need to extend resourceID, note that from v5 we do type checking for owner references, adding type annotation should do the trick, and have the secondary filter on the. Another option is just use labels/ label selectors, which is also more efficient. or rather both. But something like the primary type should be there fo sure - preferably a GroupVersionKind (GVK) as a value in some form. |
added scretch how the impl could look like, will finalize it bit later. @coltmcnealy-lh should we backport it into 4.x or you are ok to wait for v5? |
@csviri we have a workaround, which is just overriding a bunch of Thanks for the prompt response! |
I have a reconciler that extends
KubernetesCRUDNoGCDependentResource
. The created dependent has the following annotations:In my operator, I have several different
CustomResourceDefinition
s and reconcilers. Therefore, I can and do have multiple custom resources in themy-namespace
namespace calledmy-thing
.In my own code, I need to determine the owner of these resources. I can solve that by putting labels/annotations on them myself (this is quite a bit of work). However, I imagine that this is likely a vulnerability to bugs.
Proposed Solution
Add another annotation to
NoGC
resources and use that for determining ownership:The text was updated successfully, but these errors were encountered: