diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/specgen/generate/kube/kube.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go index 7d85fd2f3..bc9013afc 100644 --- a/pkg/specgen/generate/kube/kube.go +++ b/pkg/specgen/generate/kube/kube.go @@ -908,6 +908,9 @@ func getPodPorts(containers []v1.Container) []types.PortMapping { if p.HostPort != 0 && p.ContainerPort == 0 { p.ContainerPort = p.HostPort } + if p.HostPort == 0 && p.ContainerPort != 0 { + p.HostPort = p.ContainerPort + } if p.Protocol == "" { p.Protocol = "tcp" } |