Merge pull request #1583 from ddysher/fix-#1550

Ignore empty pod port spec.
This commit is contained in:
Tim Hockin 2014-10-03 20:19:07 -07:00
commit 594e7db28f
2 changed files with 7 additions and 0 deletions

View File

@ -159,6 +159,9 @@ func ResizeController(ctx api.Context, name string, replicas int, client client.
}
func portsFromString(spec string) []api.Port {
if spec == "" {
return []api.Port{}
}
parts := strings.Split(spec, ",")
var result []api.Port
for _, part := range parts {

View File

@ -285,6 +285,10 @@ func TestMakePorts(t *testing.T) {
{HostPort: 443, ContainerPort: 444},
},
},
{
"",
[]api.Port{},
},
}
for _, tt := range testCases {
ports := portsFromString(tt.spec)