add port validate when --port is set or --expose=true

This commit is contained in:
lojies
2016-07-26 17:12:10 +08:00
parent 956501b1f0
commit ef87972835
3 changed files with 10 additions and 10 deletions

View File

@@ -796,7 +796,7 @@ func updatePodPorts(params map[string]string, podSpec *api.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 = []api.ContainerPort{
{
ContainerPort: int32(port),