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

resolve service container hostname #2549

Open
RekGRpth opened this issue May 9, 2020 · 0 comments
Open

resolve service container hostname #2549

RekGRpth opened this issue May 9, 2020 · 0 comments

Comments

@RekGRpth
Copy link

RekGRpth commented May 9, 2020

how about to resolve service container hostname?
for example as follow

diff --git a/agent.go b/agent.go
index 4a5c2156..162d4b1f 100644
--- a/agent.go
+++ b/agent.go
@@ -640,6 +640,7 @@ func (ep *endpoint) addServiceInfoToCluster(sb *sandbox) error {
                if n.ingress {
                        ingressPorts = ep.ingressPorts
                }
+               ep.myAliases = append(ep.myAliases, sb.config.hostName)
                if err := c.addServiceBinding(ep.svcName, ep.svcID, n.ID(), ep.ID(), name, ep.virtualIP, ingressPorts, ep.svcAliases, ep.myAliases, ep.Iface().Address().IP, "addServiceInfoToCluster"); err != nil {
                        return err
                }

it works with templating hostname as {{.Service.Name}}-{{.Task.Slot}} or {{.Service.Name}}-{{.Node.Hostname}}

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

No branches or pull requests

1 participant