MCPcopy
hub / github.com/docker/compose / portNotFoundError

Function portNotFoundError

pkg/compose/port.go:43–55  ·  view source on GitHub ↗
(protocol string, port uint16, ctr container.Summary)

Source from the content-addressed store, hash-verified

41}
42
43func portNotFoundError(protocol string, port uint16, ctr container.Summary) error {
44 formatPort := func(protocol string, port uint16) string {
45 return fmt.Sprintf("%d/%s", port, protocol)
46 }
47
48 var containerPorts []string
49 for _, p := range ctr.Ports {
50 containerPorts = append(containerPorts, formatPort(p.Type, p.PrivatePort))
51 }
52
53 name := strings.TrimPrefix(ctr.Names[0], "/")
54 return fmt.Errorf("no port %s for container %s: %s", formatPort(protocol, port), name, strings.Join(containerPorts, ", "))
55}

Callers 1

PortMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected