-
Notifications
You must be signed in to change notification settings - Fork 567
feat(relations): watch unit relations #19309
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
The SubordinateRelationWatcher has been deleted. The functionality will now live in the relation domain's WatchPrincipalLifeSuspendedStatus method.
One is for principal units, the other for subordinates. WatchPrincipalLifeSuspendedStatus implements the logic of the former uniter facade SubordinateRelationsWatcher.
| for _, change := range changes { | ||
| relUUID := corerelation.UUID(change.Changed()) | ||
|
|
||
| changedRelationData, err := s.st.WatchLifeSuspendedStatusMapperData(ctx, relUUID, applicationID) |
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.
| changedRelationData, err := s.st.WatchLifeSuspendedStatusMapperData(ctx, relUUID, applicationID) | |
| changedRelationData, err := s.st.WatchLifeSuspendedStatusMapperData(ctx, relUUID, applicationID) |
That's starting to read like JavaBeanFactoryVistor...
| eventsource.NamespaceFilter(lifeTableName, changestream.All), | ||
| eventsource.NamespaceFilter(suspendedTableName, changestream.All), |
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 these not be predicate watchers based on the application ID?
| eventsource.NamespaceFilter(lifeTableName, changestream.All), | ||
| eventsource.NamespaceFilter(suspendedTableName, changestream.All), |
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.
Same here...
|
@hmlanigan is this PR dead? should it be closed? |
|
Closing as a POC, and split into multiple PRs. |
The uniter facade method WatchUnitRelations now uses the relation domain service rather than state.
Two new watchers have been implemented in the relation service: WatchLifeSuspendedStatus and WatchPrincipalLifeSuspendedStatus. Both watch multiple namespaces and as well as having individual mappers. Functionality from the now defunct SubordinateRelationsWatcher has been reimplemented in the WatchPrincipalLifeSuspendedStatus.
Checklist
Integration tests, with comments saying what you're testingdoc.go added or updated in changed packagesQA steps
Links
Jira card: JUJU-