Merge pull request #4712 from thockin/plural_30_endpoints

Multi-port Endpoints
This commit is contained in:
Daniel Smith
2015-02-23 13:48:37 -08:00
52 changed files with 954 additions and 541 deletions

View File

@@ -64,7 +64,7 @@ var _ = Describe("Events", func() {
{
Name: "p",
Image: "kubernetes/serve_hostname",
Ports: []api.Port{{ContainerPort: 80}},
Ports: []api.ContainerPort{{ContainerPort: 80}},
},
},
},

View File

@@ -109,7 +109,7 @@ var _ = Describe("Networking", func() {
Name: "webserver",
Image: "kubernetes/nettest:latest",
Command: []string{"-service=" + name},
Ports: []api.Port{{ContainerPort: 8080}},
Ports: []api.ContainerPort{{ContainerPort: 8080}},
},
},
},

View File

@@ -108,7 +108,7 @@ var _ = Describe("Pods", func() {
{
Name: "nginx",
Image: "dockerfile/nginx",
Ports: []api.Port{{ContainerPort: 80}},
Ports: []api.ContainerPort{{ContainerPort: 80}},
LivenessProbe: &api.Probe{
Handler: api.Handler{
HTTPGet: &api.HTTPGetAction{
@@ -165,7 +165,7 @@ var _ = Describe("Pods", func() {
{
Name: "nginx",
Image: "dockerfile/nginx",
Ports: []api.Port{{ContainerPort: 80}},
Ports: []api.ContainerPort{{ContainerPort: 80}},
LivenessProbe: &api.Probe{
Handler: api.Handler{
HTTPGet: &api.HTTPGetAction{
@@ -236,7 +236,7 @@ var _ = Describe("Pods", func() {
{
Name: "srv",
Image: "kubernetes/serve_hostname",
Ports: []api.Port{{ContainerPort: 9376}},
Ports: []api.ContainerPort{{ContainerPort: 9376}},
},
},
},

View File

@@ -86,7 +86,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
{
Name: name,
Image: image,
Ports: []api.Port{{ContainerPort: 9376, HostPort: 8080}},
Ports: []api.ContainerPort{{ContainerPort: 9376, HostPort: 8080}},
},
},
},

View File

@@ -250,8 +250,11 @@ var _ = Describe("Services", func() {
func validateIPsOrFail(c *client.Client, ns string, expectedPort int, expectedEndpoints []string, endpoints *api.Endpoints) {
ips := util.StringSet{}
for _, ep := range endpoints.Endpoints {
if ep.Port != expectedPort {
Fail(fmt.Sprintf("invalid port, expected %d, got %d", expectedPort, ep.Port))
if len(ep.Ports) == 0 {
Fail(fmt.Sprintf("invalid endpoint, no ports"))
}
if ep.Ports[0].Port != expectedPort {
Fail(fmt.Sprintf("invalid port, expected %d, got %d", expectedPort, ep.Ports[0].Port))
}
ips.Insert(ep.IP)
}
@@ -296,7 +299,7 @@ func addEndpointPodOrFail(c *client.Client, ns, name string, labels map[string]s
{
Name: "test",
Image: "kubernetes/pause",
Ports: []api.Port{{ContainerPort: 80}},
Ports: []api.ContainerPort{{ContainerPort: 80}},
},
},
},