use len > 0 to replace port > 0

This commit is contained in:
lojies 2016-09-28 10:23:25 +08:00
parent 1854bdcb0c
commit 9ef3ef3f17

View File

@ -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),