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
488bf230
Commit
488bf230
authored
Feb 09, 2015
by
Tim Hockin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4254 from smarterclayton/integration_tests_should_use_127001
Integration tests should use 127.0.0.1 consistently
parents
25659cf1
4369e31b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
integration.go
cmd/integration/integration.go
+8
-3
etcd.sh
hack/lib/etcd.sh
+3
-3
local-up-cluster.sh
hack/local-up-cluster.sh
+1
-1
No files found.
cmd/integration/integration.go
View file @
488bf230
...
@@ -82,7 +82,7 @@ func (fakeKubeletClient) GetPodStatus(host, podNamespace, podID string) (api.Pod
...
@@ -82,7 +82,7 @@ func (fakeKubeletClient) GetPodStatus(host, podNamespace, podID string) (api.Pod
default
:
default
:
glog
.
Fatalf
(
"Can't get info for: '%v', '%v - %v'"
,
host
,
podNamespace
,
podID
)
glog
.
Fatalf
(
"Can't get info for: '%v', '%v - %v'"
,
host
,
podNamespace
,
podID
)
}
}
r
,
err
:=
c
.
GetPodStatus
(
"
localhost
"
,
podNamespace
,
podID
)
r
,
err
:=
c
.
GetPodStatus
(
"
127.0.0.1
"
,
podNamespace
,
podID
)
if
err
!=
nil
{
if
err
!=
nil
{
return
r
,
err
return
r
,
err
}
}
...
@@ -114,7 +114,7 @@ func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
...
@@ -114,7 +114,7 @@ func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
func
startComponents
(
manifestURL
string
)
(
apiServerURL
string
)
{
func
startComponents
(
manifestURL
string
)
(
apiServerURL
string
)
{
// Setup
// Setup
servers
:=
[]
string
{
"http://localhost:4001"
}
servers
:=
[]
string
{}
glog
.
Infof
(
"Creating etcd client pointing to %v"
,
servers
)
glog
.
Infof
(
"Creating etcd client pointing to %v"
,
servers
)
machineList
:=
[]
string
{
"localhost"
,
"127.0.0.1"
}
machineList
:=
[]
string
{
"localhost"
,
"127.0.0.1"
}
...
@@ -163,6 +163,11 @@ func startComponents(manifestURL string) (apiServerURL string) {
...
@@ -163,6 +163,11 @@ func startComponents(manifestURL string) (apiServerURL string) {
glog
.
Fatalf
(
"Nonnumeric port? %v"
,
err
)
glog
.
Fatalf
(
"Nonnumeric port? %v"
,
err
)
}
}
publicAddress
:=
net
.
ParseIP
(
host
)
if
publicAddress
==
nil
{
glog
.
Fatalf
(
"no public address for %s"
,
host
)
}
// Create a master and install handlers into mux.
// Create a master and install handlers into mux.
m
:=
master
.
New
(
&
master
.
Config
{
m
:=
master
.
New
(
&
master
.
Config
{
Client
:
cl
,
Client
:
cl
,
...
@@ -174,7 +179,7 @@ func startComponents(manifestURL string) (apiServerURL string) {
...
@@ -174,7 +179,7 @@ func startComponents(manifestURL string) (apiServerURL string) {
AdmissionControl
:
admit
.
NewAlwaysAdmit
(),
AdmissionControl
:
admit
.
NewAlwaysAdmit
(),
ReadWritePort
:
portNumber
,
ReadWritePort
:
portNumber
,
ReadOnlyPort
:
portNumber
,
ReadOnlyPort
:
portNumber
,
PublicAddress
:
net
.
ParseIP
(
host
)
,
PublicAddress
:
publicAddress
,
CacheTimeout
:
2
*
time
.
Second
,
CacheTimeout
:
2
*
time
.
Second
,
})
})
handler
.
delegate
=
m
.
Handler
handler
.
delegate
=
m
.
Handler
...
...
hack/lib/etcd.sh
View file @
488bf230
...
@@ -40,12 +40,12 @@ kube::etcd::start() {
...
@@ -40,12 +40,12 @@ kube::etcd::start() {
# Start etcd
# Start etcd
ETCD_DIR
=
$(
mktemp
-d
-t
test-etcd.XXXXXX
)
ETCD_DIR
=
$(
mktemp
-d
-t
test-etcd.XXXXXX
)
kube::log::usage
"etcd -data-dir
${
ETCD_DIR
}
--bind-addr
${
host
}
:
${
port
}
>/dev/null 2>/dev/null"
kube::log::usage
"etcd -data-dir
${
ETCD_DIR
}
--bind-addr
${
host
}
:
${
port
}
>/dev/null 2>/dev/null"
etcd
-data-dir
${
ETCD_DIR
}
-addr
${
host
}
:
${
port
}
>
/dev/null 2>/dev/null &
etcd
-data-dir
${
ETCD_DIR
}
-
-bind-
addr
${
host
}
:
${
port
}
>
/dev/null 2>/dev/null &
ETCD_PID
=
$!
ETCD_PID
=
$!
echo
"Waiting for etcd to come up."
echo
"Waiting for etcd to come up."
kube::util::wait_for_url
"http://
${
test
host
}
:
${
port
}
/v2/machines"
"etcd: "
0.25 80
kube::util::wait_for_url
"http://
${
host
}
:
${
port
}
/v2/machines"
"etcd: "
0.25 80
curl
-X
PUT
"http://
${
test
host
}
:
${
port
}
/v2/keys/_test"
curl
-X
PUT
"http://
${
host
}
:
${
port
}
/v2/keys/_test"
}
}
kube::etcd::cleanup
()
{
kube::etcd::cleanup
()
{
...
...
hack/local-up-cluster.sh
View file @
488bf230
...
@@ -93,7 +93,7 @@ sudo "${GO_OUT}/kube-apiserver" \
...
@@ -93,7 +93,7 @@ sudo "${GO_OUT}/kube-apiserver" \
--address
=
"
${
API_HOST
}
"
\
--address
=
"
${
API_HOST
}
"
\
--port
=
"
${
API_PORT
}
"
\
--port
=
"
${
API_PORT
}
"
\
--runtime_config
=
api/v1beta3
\
--runtime_config
=
api/v1beta3
\
--etcd_servers
=
"http://
localhost
:4001"
\
--etcd_servers
=
"http://
127.0.0.1
:4001"
\
--portal_net
=
"10.0.0.0/24"
\
--portal_net
=
"10.0.0.0/24"
\
--cors_allowed_origins
=
"
${
API_CORS_ALLOWED_ORIGINS
}
"
>
"
${
APISERVER_LOG
}
"
2>&1 &
--cors_allowed_origins
=
"
${
API_CORS_ALLOWED_ORIGINS
}
"
>
"
${
APISERVER_LOG
}
"
2>&1 &
APISERVER_PID
=
$!
APISERVER_PID
=
$!
...
...
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