-
Notifications
You must be signed in to change notification settings - Fork 11
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
Send an empty payload if a cluster was not found #227
Conversation
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.
A little change request
c5209f5
to
2c3aa2c
Compare
@fabriziosestito As talked offline, with the current change this is the payload that is generated:
I think the |
2c3aa2c
to
fd262e4
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.
Good!
Now we have:
{"agent_id":"xxx","discovery_type":"ha_cluster_discovery","payload":null}
If sending null
in the payload is good enough for the backend (you might know more on that than me hehe), the code works as expected
func NewClusterWithDiscoveryTools(discoveryTools *DiscoveryTools) (Cluster, error) { | ||
var cluster = Cluster{ | ||
func NewClusterWithDiscoveryTools(discoveryTools *DiscoveryTools) (*Cluster, error) { | ||
commandExecutor := utils.Executor{} |
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.
Why have you changed the order of the things here?
Was something wrong?
Or is it simply to avoid the declaration of a not needed var?
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.
Or is it simply to avoid the declaration of a not needed var?
this
This PR sends an empty payload if a cluster was not found, instead of returning from the discovery loop.
This is useful in the delta deregistration to remove a host from a cluster if previously it was part of it.