-
Notifications
You must be signed in to change notification settings - Fork 183
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
CRUDKubernetesDependentResource#delete()
Deletes Non-Children Resources
#2349
Comments
One workaround for now is to just make sure to avoid naming clashes. But that's not exactly ideal, and when we ship our Operator as a product to our customers (which we are doing soon), we can't guarantee that they will follow such practices. |
Hi, the issue is here, when mapping from owner references: Line 102 in a08d725
To solve this cross namespace, we need to add Will schedule this just for v5 (if no objections), since it is already handling the primary type sort of, which could be enhanced and the reference type easily checked. |
Thanks for the update! Is there a ticket I can use to track the V5 progress? Also, for now it looks like I can solve the issue by implementing |
There is a milestone:
yes, definitely, you can do that, that will fix it. |
Bug Report
I have a
KafkaUserDR
which is aCRUDKubernetesDependentResource<KafkaUser, LHCluster>
. In myLHClusterReconciler#reconcile
method, I callkafkaUserDR.delete(...)
.KafkaUser
is the class of the CRD that is created by the Dependent Resource, andLHCluster
is the primary.The name of the Primary resource (the
LHCluster
) ismy-cluster
. I had another CRD of a different type (LHKafkaUser
), and that an instance of that CRD also namedmy-cluster
.The
LHKafkaUser
CRD creates as a dependent aKafkaUser
and therefore put anownerRef
on the createdKafkaUser
. The ownerRef on thatKafkaUser
correctly reported thekind: LHKafkaUser
.However, in the LHCluster Reconciler, calling
delete()
on thekafkaUserDR
incorrectly deleted that resource: it was owned by theLHKafkaUser
and NOT by theLHCluster
.Potential Fix
I think the fix is that the
CRUDKubernetesDependentResource#delete()
method needs to check both thename
andkind
on theownerRef
of resources before deleting it. Right now, the behavior suggests that it is not checking thekind
.Environment
Using a KIND cluster. JOSDK version
4.4.x
The text was updated successfully, but these errors were encountered: