GetPublishedPortForPrivatePort returns the host-exposed public port of a container for a given private port.
(serviceName string, privatePort uint16)
| 606 | |
| 607 | // GetPublishedPortForPrivatePort returns the host-exposed public port of a container for a given private port. |
| 608 | func (app *DdevApp) GetPublishedPortForPrivatePort(serviceName string, privatePort uint16) (publicPort int, err error) { |
| 609 | c, err := app.FindContainerByType(serviceName) |
| 610 | if err != nil || c == nil { |
| 611 | return -1, fmt.Errorf("failed to find container of type %s: %v", serviceName, err) |
| 612 | } |
| 613 | publishedPort := dockerutil.GetPublishedPort(privatePort, *c) |
| 614 | return publishedPort, nil |
| 615 | } |
| 616 | |
| 617 | // GetOmittedContainers returns full list of global and local omitted containers |
| 618 | func (app *DdevApp) GetOmittedContainers() []string { |