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

Service aliases #660

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pelletier
Copy link

This commit makes it possible for a given container to advertise
multiple services using aliases.

For example, the following config:

SERVICE_NAME=a
SERVICE_ALIASES=b,c

will result in 3 services being registered: a, b, and c. All three
pointing to the same container.

Those changes should be compatible with ports, and tags.

This should fix #328

This commit makes it possible for a given container to advertise
multiple services using aliases.

For example, the following config:

```
SERVICE_NAME=a
SERVICE_ALIASES=b,c
```

will result in 3 services being registered: a, b, and c. All three
pointing to the same container.

Those changes should be compatible with ports, and tags.
Copy link

@ben ben left a comment

Choose a reason for hiding this comment

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

(lgtm)

@pelletier
Copy link
Author

@josegonzalez any chance we could get some feedback on this please? :)

id := mapDefault(metadata, "id", "")
if id != "" {
service.ID = id
service.Attrs = metadata
Copy link

Choose a reason for hiding this comment

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

This looks like a subtle difference, by assigning the service.Attrs = metadata here means that the metadata still contains the id, tags, name fields? Note that in the original code, there are three calls to delete(metadata, ...) to remove those fields before assigning service.Attrs = metadata. Is this any cause for concern or change in registration behavior?

Copy link

Choose a reason for hiding this comment

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

(I realize it's been almost two years since this PR was posted, and I doubt there will be any further activity on this project, but this PR solves a problem I was just researching in how to coordinate a service name transition period!)

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.

Support multiple service names per port
3 participants