-
Notifications
You must be signed in to change notification settings - Fork 218
Primary to seconday dr informer sample #1744
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
821760a
to
075da50
Compare
operator-framework/src/test/java/io/javaoperatorsdk/operator/PrimaryToSecondaryDependentIT.java
Show resolved
Hide resolved
return Map.of(CONFIG_MAP_EVENT_SOURCE, cmES); | ||
} | ||
|
||
private String indexKey(String clusterName, String namespace) { |
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.
This should be the configMapName
instead of clusterName
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.
fixed
...torsdk/operator/sample/primarytosecondaydependent/PrimaryToSecondaryDependentReconciler.java
Show resolved
Hide resolved
This should be rebased on |
docs/documentation/v4-3-migration.md
Outdated
## Condition API Change | ||
|
||
In Workflows the target of the condition was the managed resource itself, not a dependent resource. This changed, from | ||
not the API contains the dependent resource. |
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 don't understand that part…
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.
changed
/** | ||
* Here just simply creating an Event Source, and setting it for the Dependent Resource. Since it | ||
* is not possible to do this setup within the bounds of the KubernetesDependentResource API. | ||
* However, this is quite a corner case; might be covered more out of the box in the future if |
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, I think we should provide a way for dependents to initialize their event sources if needed in the future.
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.
So this is doable also now just not in an elegant way, and did not want to confuse users. One way it would be just to override this method:
The SecondaryToPrimary is supported explicitly, but would not be useful to support the PrimaryToSecondary in same way, since for that (as in the example) also access to the context is needed.
We can think about this in the future more, how to cover also this case more elegantly in KubernetesDependentResource, however it's kinda rare case as mentioned. Since not sure if users might want to use dependent resources for these read-only cases.
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 use dependent resources everywhere I can, in a declarative way, so I'm all in favor of making everything possible declaratively (as long as we can do it in an elegant way)… 😄
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.
The thing is that in this cases this is a ready only resource, not reallly reconciled, and that is what dependent resources primary does, so at least it is smelly here a little bit.
Tbh I'm not big fan of annotations, but in this would be good to have possibility to do event sources by annotation as we prototyped in the past - to be consistent at least.
...torsdk/operator/sample/primarytosecondaydependent/PrimaryToSecondaryDependentReconciler.java
Show resolved
Hide resolved
8556ea0
to
3345435
Compare
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.
LGTM apart some more documentation improvements
…per with dependent resources
3345435
to
81f7e30
Compare
Kudos, SonarCloud Quality Gate passed! |
No description provided.