Merge pull request #9736 from sdminonne/bug_fix2

To add validation for service ports when defined as string
This commit is contained in:
Maxwell Forbes
2015-06-25 19:37:04 -07:00
13 changed files with 193 additions and 94 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
func makeValidService() api.Service {
@@ -36,7 +37,7 @@ func makeValidService() api.Service {
Selector: map[string]string{"key": "val"},
SessionAffinity: "None",
Type: api.ServiceTypeClusterIP,
Ports: []api.ServicePort{{Name: "p", Protocol: "TCP", Port: 8675}},
Ports: []api.ServicePort{{Name: "p", Protocol: "TCP", Port: 8675, TargetPort: util.NewIntOrStringFromInt(8675)}},
},
}
}