Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c630f666
Commit
c630f666
authored
Mar 11, 2015
by
Alex Mohr
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5165 from roberthbailey/rc-hostports
Remove the host port from the replication controller e2e test.
parents
d93dde48
a32f0240
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
rc.go
test/e2e/rc.go
+8
-14
No files found.
test/e2e/rc.go
View file @
c630f666
...
...
@@ -18,8 +18,6 @@ package e2e
import
(
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
...
...
@@ -65,7 +63,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
replicas
:=
2
// Create a replication controller for a service
// that serves its hostname
on port 8080
.
// that serves its hostname.
// The source for the Docker containter kubernetes/serve_hostname is
// in contrib/for-demos/serve_hostname
By
(
fmt
.
Sprintf
(
"Creating replication controller %s"
,
name
))
...
...
@@ -87,7 +85,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
{
Name
:
name
,
Image
:
image
,
Ports
:
[]
api
.
ContainerPort
{{
ContainerPort
:
9376
,
HostPort
:
8080
}},
Ports
:
[]
api
.
ContainerPort
{{
ContainerPort
:
9376
}},
},
},
},
...
...
@@ -165,19 +163,15 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
By
(
"Trying to dial each unique pod"
)
for
i
,
pod
:=
range
pods
.
Items
{
resp
,
err
:=
http
.
Get
(
fmt
.
Sprintf
(
"http://%s:8080"
,
pod
.
Status
.
HostIP
))
body
,
err
:=
c
.
Get
()
.
Prefix
(
"proxy"
)
.
Resource
(
"pods"
)
.
Name
(
string
(
pod
.
Name
))
.
Do
()
.
Raw
()
if
err
!=
nil
{
Failf
(
"Controller %s: Failed to GET from replica %d: %v"
,
name
,
i
+
1
,
err
)
}
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
!=
http
.
StatusOK
{
Failf
(
"Controller %s: Expected OK status code for replica %d but got %d"
,
name
,
i
+
1
,
resp
.
StatusCode
)
}
body
,
err
:=
ioutil
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
Failf
(
"Controller %s: Failed to read the body of the GET response from replica %d: %v"
,
name
,
i
+
1
,
err
)
}
// The body should be the pod name.
if
string
(
body
)
!=
pod
.
Name
{
Failf
(
"Controller %s: Replica %d expected response %s but got %s"
,
name
,
i
+
1
,
pod
.
Name
,
string
(
body
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment