From 9ef3ef3f17a4428007c4329d6f47ed44892ea636 Mon Sep 17 00:00:00 2001 From: lojies Date: Wed, 28 Sep 2016 10:23:25 +0800 Subject: [PATCH] use len > 0 to replace port > 0 --- pkg/kubectl/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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),