Skip to content

Commit

Permalink
fix where providing a SERVICE_NAME for a container with multiple port…
Browse files Browse the repository at this point in the history
…s exposed would cause services to overwrite each other
  • Loading branch information
Adam Burnett committed Jun 17, 2015
1 parent 84cc01f commit efdab22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ func (b *Bridge) add(containerId string, quiet bool) {
func (b *Bridge) newService(port ServicePort, isgroup bool) *Service {
container := port.container
defaultName := strings.Split(path.Base(container.Config.Image), ":")[0]
if isgroup {
defaultName = defaultName + "-" + port.ExposedPort
}


// not sure about this logic. kind of want to remove it.
hostname, err := os.Hostname()
if err != nil {
Expand Down Expand Up @@ -208,6 +205,9 @@ func (b *Bridge) newService(port ServicePort, isgroup bool) *Service {
service.Origin = port
service.ID = hostname + ":" + container.Name[1:] + ":" + port.ExposedPort
service.Name = mapDefault(metadata, "name", defaultName)
if isgroup {

This comment has been minimized.

Copy link
@JohnyDays

JohnyDays Sep 10, 2015

Contributor

if isgroup && !metadata["name"]

That should fix it right?

This comment has been minimized.

Copy link
@progrium

progrium Sep 10, 2015

Contributor

That sounds right. But more eyeballs would help.

service.Name += "-" + port.ExposedPort
}
var p int
if b.config.Internal == true {
service.IP = port.ExposedIP
Expand Down

0 comments on commit efdab22

Please sign in to comment.