mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
add port validate when --port is set or --expose=true
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user