aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/kube/kube.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/kube/kube.go')
-rw-r--r--pkg/specgen/generate/kube/kube.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index b1828736d..2a0d80cb8 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -914,6 +914,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"
}