- Notifications
You must be signed in to change notification settings - Fork235
Create Dependent Resource in Different Namespace#1917
-
How do I create a Dependent Resource in a different namespace than the Primary? The use-case is that I need to create a Certificate in the Currently, using the "Managed Dependent Resource" feature, if the namespace in the |
BetaWas this translation helpful?Give feedback.
All reactions
Hi@coltmcnealy-lh , the key is not to implementGarbageCollected interface. So not useCRUDKubernetesDependentResource. owner reference if added only in that case.
Note that in this case the default behavior is to add annotations to handle the related behavior, deleting the resouce:
https://github.com/java-operator-sdk/java-operator-sdk/blob/5a8ae993b9b1cc3f56ce4c784f85b15910b1c9bb/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L204-L204
Replies: 1 comment 6 replies
-
Hi@coltmcnealy-lh , the key is not to implement Note that in this case the default behavior is to add annotations to handle the related behavior, deleting the resouce: |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ohh, no, that should work, will check if there is a related integration test missing. Could you pls create an issue? will fix this if it broken, and release a patch for that if that is the case. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Before I raise a false alarm, let me do a bit more digging. It also has a ResourceDiscriminator which might be improperly implemented. The Discriminator uses |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
ahh, ok! thx! but anyways, I cannot find an integration test on first check (we have a huge amount now :) ), so will add one to verify |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ah, it was working, my ResourceDiscriminator was improperly implemented. Quick question, here is my DependentResource Class implementation. Are both the SecondaryToPrimaryMapper and PrimaryToSecondaryMapper needed? Can I optimize it in any way to reduce the number of K8s API calls? |
BetaWas this translation helpful?Give feedback.
All reactions
-
https://javaoperatorsdk.io/docs/features#managing-relation-between-primary-and-secondary-resources |
BetaWas this translation helpful?Give feedback.