Skip to content
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

phx: less brittle node naming for dns_cluster #3993

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

clutterstack
Copy link

Change Summary

What and Why:
The node naming in env.sh.eex as generated by the Phoenix scanner works great if it gets a default tag of the form "deployment-", but broke with an invalid Erlang node name when I deployed using the --image-label flag to get a custom tag containing no hyphen.

How:
As described in #2554, the launch callback as-is creates a node name that uses the unique part of the default image tag when it's of the expected form. This PR suggests a way to strip deployment- if present, and otherwise just use the tag to identify the image version.

Build of app garbage with default tagging by fly deploy:

iex(garbage-01J9ST7EVHM23NPVE448VR2RW7@fdaa:0:3b99:a7b:ef:7c89:2bca:2)1> 

and on a different build using fly deploy --image-label test (FLY_IMAGE_REF=registry.fly.io/garbage:test):

iex(garbage-test@fdaa:0:3b99:a7b:ef:7c89:2bca:2)1> 

And with three nodes running:

iex(garbage-test@fdaa:0:3b99:a7b:174:d855:55b8:2)1> Node.list()
[:"garbage-test@fdaa:0:3b99:a7b:ef:7c89:2bca:2",
 :"garbage-test@fdaa:0:3b99:a7b:1d4:7a95:987b:2"]

Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a

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.

1 participant