Skip to content

Commit

Permalink
make the list of container ports unique
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Nov 13, 2015
1 parent 7b5ec74 commit 6b70ffd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/models/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,19 @@ func (me ManifestEntry) InternalPorts() []string {
}

func (me ManifestEntry) ContainerPorts() []string {
extmap := map[string]bool{}
ext := []string{}

for _, port := range me.Ports {
if parts := strings.Split(port, ":"); len(parts) == 2 {
ext = append(ext, parts[1])
extmap[parts[1]] = true
}
}

for k, _ := range extmap {
ext = append(ext, k)
}

return ext
}

Expand Down

0 comments on commit 6b70ffd

Please sign in to comment.