-
Notifications
You must be signed in to change notification settings - Fork 96
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
Unnecessary owner references #1358
Comments
/cc @Rozzii |
I agree with you @lentzi90 as we have discussed this off GitHub, I will bring this up on triaging session on Wednesday, I would like a wide discussion over this involving as many of the contributors as possible. |
/cc @zaneb @hroyrh @hardys @kashifest @furkatgofurov7 @dtantsur not sure who else would be interested in this. |
Not an expert on CAPM3, but in general there's 2 motivations:
(Ideally these line up, but they don't always.)
Depending on what the IPAddress represents, this sounds potentially suspect.
Agree that it should not, and this is why we have the "Consumer" field in the BMH. (The Metal3Machine "owns" the deployment on the BMH, but not the BMH itself. Really that should be a separate CRD, but today it is not.) Although the graph already shows the relationship as "consumes" not "owns"?
If the grandparent is the one that needs to be reconciled when the child changes then this is not necessarily unreasonable. But it does leave the grandparent with some cleanup to do if e.g. the parent gets deleted and does not have a finalizer that also removes the child. A way to resolve this would be to roll up into the parent's status any status information from the child that the grandparent needs to watch. |
I should have mentioned... don't trust this graph too much. There is a lot missing. Many objects have references to the cluster |
This one definitely feels wrong to me. |
/triage accepted |
THis could be a good topic for the 2024 MTM |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
1 similar comment
/remove-lifecycle stale |
This is going back and forth between stale and active and there is not active work on it at the moment, I am putting the frozen label on this issue, feel free to continue the work whenever you would like to. |
/assign |
What steps did you take and what happened:
This owner structure seems quite strange and unnecessary. Why should the Metal3Machine own the Metal3Data for example when it already owns the Metal3DataClaim? And why should it own the BareMetalHost that is most likely created by the user?
These relations makes it harder to reason about behaviors and understanding the structure.
The owner references are usually used to delete owned objects when the owner is deleted. Owning both the parent and child, like is the case with the IPClaim and IPAddress, is not necessary and can lead to surprising behaviors.
What did you expect to happen:
The owner chain should not have situations where the grand parent owns both parent and child.
We should not put owner references on objects lightly. In general they belong on objects created from or managed by the owner, that should be deleted when the owner is deleted.
Anything else you would like to add:
There may be reasons for the structure that we have, but I have not been able to find them.
The main goal with this issue is to think critically about the structure we have, and think about if/how we can improve it.
Here is a (WIP) graph of the relations:
Environment:
kubectl version
): v1.28.3/kind bug
The text was updated successfully, but these errors were encountered: