-
Notifications
You must be signed in to change notification settings - Fork 487
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
Allow the Host interface to return services. #6348
Conversation
The new method on the Host interface allows services to call out to other services during runtime. Signed-off-by: Paschalis Tsilias <[email protected]>
This commit introduces a service.Provider interface as a counterpart to component.Provider. Signed-off-by: Paschalis Tsilias <[email protected]>
Using the previous commits as groundwork, we can now directly call to the clustering service from the web/api package. Signed-off-by: Paschalis Tsilias <[email protected]>
Signed-off-by: Paschalis Tsilias <[email protected]>
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.
Thanks!
@@ -26,6 +26,15 @@ func (f *Flow) GetServiceConsumers(serviceName string) []service.Consumer { | |||
return consumers | |||
} | |||
|
|||
func (f *Flow) GetService(name string) (service.Service, bool) { |
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.
Godoc?
service/service.go
Outdated
// A Provider exposes information around services. | ||
type Provider interface { | ||
// GetService looks up a running service using its name. | ||
GetService(name string) (Service, bool) | ||
} |
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'm guessing we need this and can't just use service.Host?
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 thought that maybe there was a reason we'd hooked it up as component.Provider in web/api
, but yeah, we can use service.Host directly here.
This commit removes the service.Provider interface since web/api can use service.Host itself as an implementation for retrieving components and services. Signed-off-by: Paschalis Tsilias <[email protected]>
Signed-off-by: Paschalis Tsilias <[email protected]>
PR Description
This PR enables the Host interface to access other running services. Currently, this simplifies the handling around the UI service and the cluster.Cluster interface it calls to, but in the future this can also help the remotecfg service populate some UI interface.
Which issue(s) this PR fixes
No issue filed.
Notes to the Reviewer
cc @rfratto from a TODO comment as he's already thought about this in the past.
PR Checklist