-
Notifications
You must be signed in to change notification settings - Fork 222
feat: throw exception on problematic owner ference adding in dependent resources #2190
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
Conversation
…t resources Signed-off-by: Attila Mészáros <[email protected]>
@@ -71,6 +74,30 @@ public static String getNameFor(Class<? extends Reconciler> reconcilerClass) { | |||
return getDefaultNameFor(reconcilerClass); | |||
} | |||
|
|||
public static void checkIfCanAddOwnerReference(HasMetadata owner, HasMetadata resource) { | |||
if (owner instanceof GenericKubernetesResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move this code to the Fabric8 client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add it to addOwnerReference
, personally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, me too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be part of HasMetadata#addOwnerReference.
The other suggested alternative would involve exposing the validation method and then calling that method within addOwnerReference too. I don't really see the value of exposing that method.
…t resources (#2190) Signed-off-by: Attila Mészáros <[email protected]>
…t resources (#2190) Signed-off-by: Attila Mészáros <[email protected]>
…t resources (#2190) Signed-off-by: Attila Mészáros <[email protected]>
No description provided.