Skip to content

Conversation

@andrew-edgar
Copy link
Contributor

Thank you for submitting a pull request to the diego-release repository. We appreciate the contribution. To help us with getting better context for the pull request please follow these guidelines:

Please make sure to complete the following steps

  • Before PR Submission, Submit an issue for either an Enhancement or Bug
  • Check the Contributing document on how to sign the CLA and run tests in diego-release.
  • Make sure a pull request is done against the develop branch.

Issue Link

#529

Thank you!

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

Copy link
Contributor

@flawedmatrix flawedmatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part this change seems reasonable to me.

nats_machines = ips.compact
end.else_if_link('nats') do
nats_machines = link('nats').instances.map { |instance| instance.address }
end.else do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if getting rid of the if_link('nats') check would break anything

Copy link
Contributor Author

@andrew-edgar andrew-edgar Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not really an issue. The previous code if there was no nats link and no nats.machines specified would set nothing for the nats addresses. And the route_emitter would fail connecting to nats.

Now this code will, if there is no nats.machines specified and there is no nats link, fail trying to get the nats link on line 8.

Both will have the route_emitter failing. This code is exactly the same as what the route_registrar does and that is why I implemented it as such.

If you want the route_emitter to fail the same way it does now instead of failing this new way we could change line 7 to match the end.else_if_link('nats') do

But I do feel that it is better to fail during the deployment rather than have a successful deploy that when the route_emitter starts will not be able to connect to nats

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand Andrew correctly, previously, if there was no nats link and no nats.machines specified, then the code would set nothing for the nats addresses. And then the route_emitter would subsequently fail at runtime because it would be unable to connect to nats as there were no machines/addresses.
This PR will change the behavior so that it will fail at deploy time because it cannot get the required nats link. That is better than failing at runtime

nats_machines = ips.compact
end.else_if_link('nats') do
nats_machines = link('nats').instances.map { |instance| instance.address }
end.else do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

@andrew-edgar
Copy link
Contributor Author

the changes that were requested were done on further chatting they were required and it was simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants