diff --git a/pkg/kubectl/run.go b/pkg/kubectl/run.go index d4f33b5d8a1..2cc02a6aea9 100644 --- a/pkg/kubectl/run.go +++ b/pkg/kubectl/run.go @@ -830,7 +830,7 @@ func updateV1PodPorts(params map[string]string, podSpec *v1.PodSpec) (err error) } // Don't include the port if it was not specified. - if port > 0 { + if len(params["port"]) > 0 { podSpec.Containers[0].Ports = []v1.ContainerPort{ { ContainerPort: int32(port),