From 6a97d6f65e0b65a084636e8db6e404c7f43c2df0 Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Sat, 2 May 2015 17:14:22 -0700 Subject: [PATCH] stage1/init: Use pod manifest to get forwarded ports Instead of using image manifest to get forwarded ports, we should use pod manifest. --- stage1/init/init.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stage1/init/init.go b/stage1/init/init.go index 034cf07..b8953cd 100644 --- a/stage1/init/init.go +++ b/stage1/init/init.go @@ -222,16 +222,16 @@ func forwardedPorts(pod *Pod) ([]networking.ForwardedPort, error) { n := "" fp := networking.ForwardedPort{} - for an, a := range pod.Apps { + for _, a := range pod.Manifest.Apps { for _, p := range a.App.Ports { if p.Name == ep.Name { if n == "" { fp.Protocol = p.Protocol fp.HostPort = ep.HostPort fp.PodPort = p.Port - n = an + n = a.Name.String() } else { - return nil, fmt.Errorf("Ambiguous exposed port in PodManifest: %q and %q both define port %q", n, an, p.Name) + return nil, fmt.Errorf("Ambiguous exposed port in PodManifest: %q and %q both define port %q", n, a.Name, p.Name) } } }