mirror of
https://github.com/clearlinux/rkt.git
synced 2026-11-22 03:53:23 +00:00
Merge pull request #858 from yifan-gu/forward_port
stage1/init: Use pod manifest to get forwarded ports
This commit is contained in:
+3
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user