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
5740c7af
Commit
5740c7af
authored
Jul 24, 2017
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ha_master tests
parent
4d2a7212
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
util.sh
cluster/gce/util.sh
+8
-10
ha_master.go
test/e2e/lifecycle/ha_master.go
+6
-10
No files found.
cluster/gce/util.sh
View file @
5740c7af
...
@@ -2035,8 +2035,7 @@ function test-setup() {
...
@@ -2035,8 +2035,7 @@ function test-setup() {
detect-project
detect-project
if
[[
${
MULTIZONE
:-}
==
"true"
&&
-n
${
E2E_ZONES
:-}
]]
;
then
if
[[
${
MULTIZONE
:-}
==
"true"
&&
-n
${
E2E_ZONES
:-}
]]
;
then
for
KUBE_GCE_ZONE
in
${
E2E_ZONES
}
for
KUBE_GCE_ZONE
in
${
E2E_ZONES
}
;
do
do
KUBE_GCE_ZONE
=
"
${
KUBE_GCE_ZONE
}
"
KUBE_USE_EXISTING_MASTER
=
"
${
KUBE_USE_EXISTING_MASTER
:-}
"
"
${
KUBE_ROOT
}
/cluster/kube-up.sh"
KUBE_GCE_ZONE
=
"
${
KUBE_GCE_ZONE
}
"
KUBE_USE_EXISTING_MASTER
=
"
${
KUBE_USE_EXISTING_MASTER
:-}
"
"
${
KUBE_ROOT
}
/cluster/kube-up.sh"
KUBE_USE_EXISTING_MASTER
=
"true"
# For subsequent zones we use the existing master
KUBE_USE_EXISTING_MASTER
=
"true"
# For subsequent zones we use the existing master
done
done
...
@@ -2092,15 +2091,14 @@ function test-teardown() {
...
@@ -2092,15 +2091,14 @@ function test-teardown() {
"
${
NODE_TAG
}
-
${
INSTANCE_PREFIX
}
-http-alt"
\
"
${
NODE_TAG
}
-
${
INSTANCE_PREFIX
}
-http-alt"
\
"
${
NODE_TAG
}
-
${
INSTANCE_PREFIX
}
-nodeports"
"
${
NODE_TAG
}
-
${
INSTANCE_PREFIX
}
-nodeports"
if
[[
${
MULTIZONE
:-}
==
"true"
&&
-n
${
E2E_ZONES
:-}
]]
;
then
if
[[
${
MULTIZONE
:-}
==
"true"
&&
-n
${
E2E_ZONES
:-}
]]
;
then
local
zones
=(
${
E2E_ZONES
}
)
local
zones
=(
${
E2E_ZONES
}
)
# tear them down in reverse order, finally tearing down the master too.
# tear them down in reverse order, finally tearing down the master too.
for
((
zone_num
=
${#
zones
[@]
}
-1
;
zone_num>0
;
zone_num--
))
for
((
zone_num
=
${#
zones
[@]
}
-1
;
zone_num>0
;
zone_num--
))
;
do
do
KUBE_GCE_ZONE
=
"
${
zones
[zone_num]
}
"
KUBE_USE_EXISTING_MASTER
=
"true"
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
KUBE_GCE_ZONE
=
"
${
zones
[zone_num]
}
"
KUBE_USE_EXISTING_MASTER
=
"true"
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
done
done
KUBE_GCE_ZONE
=
"
${
zones
[0]
}
"
KUBE_USE_EXISTING_MASTER
=
"false"
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
KUBE_GCE_ZONE
=
"
${
zones
[0]
}
"
KUBE_USE_EXISTING_MASTER
=
"false"
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
else
else
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
"
${
KUBE_ROOT
}
/cluster/kube-down.sh"
fi
fi
}
}
...
...
test/e2e/lifecycle/ha_master.go
View file @
5740c7af
...
@@ -32,8 +32,7 @@ import (
...
@@ -32,8 +32,7 @@ import (
func
addMasterReplica
(
zone
string
)
error
{
func
addMasterReplica
(
zone
string
)
error
{
framework
.
Logf
(
fmt
.
Sprintf
(
"Adding a new master replica, zone: %s"
,
zone
))
framework
.
Logf
(
fmt
.
Sprintf
(
"Adding a new master replica, zone: %s"
,
zone
))
v
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-grow-cluster.sh"
),
zone
,
"true"
,
"true"
,
"false"
)
_
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-grow-cluster.sh"
),
zone
,
"true"
,
"true"
,
"false"
)
framework
.
Logf
(
"%s"
,
v
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -42,8 +41,7 @@ func addMasterReplica(zone string) error {
...
@@ -42,8 +41,7 @@ func addMasterReplica(zone string) error {
func
removeMasterReplica
(
zone
string
)
error
{
func
removeMasterReplica
(
zone
string
)
error
{
framework
.
Logf
(
fmt
.
Sprintf
(
"Removing an existing master replica, zone: %s"
,
zone
))
framework
.
Logf
(
fmt
.
Sprintf
(
"Removing an existing master replica, zone: %s"
,
zone
))
v
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-shrink-cluster.sh"
),
zone
,
"true"
,
"false"
,
"false"
)
_
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-shrink-cluster.sh"
),
zone
,
"true"
,
"false"
,
"false"
)
framework
.
Logf
(
"%s"
,
v
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -52,8 +50,7 @@ func removeMasterReplica(zone string) error {
...
@@ -52,8 +50,7 @@ func removeMasterReplica(zone string) error {
func
addWorkerNodes
(
zone
string
)
error
{
func
addWorkerNodes
(
zone
string
)
error
{
framework
.
Logf
(
fmt
.
Sprintf
(
"Adding worker nodes, zone: %s"
,
zone
))
framework
.
Logf
(
fmt
.
Sprintf
(
"Adding worker nodes, zone: %s"
,
zone
))
v
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-grow-cluster.sh"
),
zone
,
"true"
,
"false"
,
"true"
)
_
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-grow-cluster.sh"
),
zone
,
"true"
,
"false"
,
"true"
)
framework
.
Logf
(
"%s"
,
v
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -62,8 +59,7 @@ func addWorkerNodes(zone string) error {
...
@@ -62,8 +59,7 @@ func addWorkerNodes(zone string) error {
func
removeWorkerNodes
(
zone
string
)
error
{
func
removeWorkerNodes
(
zone
string
)
error
{
framework
.
Logf
(
fmt
.
Sprintf
(
"Removing worker nodes, zone: %s"
,
zone
))
framework
.
Logf
(
fmt
.
Sprintf
(
"Removing worker nodes, zone: %s"
,
zone
))
v
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-shrink-cluster.sh"
),
zone
,
"true"
,
"true"
,
"true"
)
_
,
_
,
err
:=
framework
.
RunCmd
(
path
.
Join
(
framework
.
TestContext
.
RepoRoot
,
"hack/e2e-internal/e2e-shrink-cluster.sh"
),
zone
,
"true"
,
"true"
,
"true"
)
framework
.
Logf
(
"%s"
,
v
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -82,7 +78,7 @@ func createNewRC(c clientset.Interface, ns string, name string) {
...
@@ -82,7 +78,7 @@ func createNewRC(c clientset.Interface, ns string, name string) {
}
}
func
findRegionForZone
(
zone
string
)
string
{
func
findRegionForZone
(
zone
string
)
string
{
region
,
err
:=
exec
.
Command
(
"gcloud"
,
"compute"
,
"zones"
,
"list"
,
zone
,
"--quiet"
,
"--format=[no-heading](region)"
)
.
CombinedOutput
()
region
,
err
:=
exec
.
Command
(
"gcloud"
,
"compute"
,
"zones"
,
"list"
,
zone
,
"--quiet"
,
"--format=
csv
[no-heading](region)"
)
.
CombinedOutput
()
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
if
string
(
region
)
==
""
{
if
string
(
region
)
==
""
{
framework
.
Failf
(
"Region not found; zone: %s"
,
zone
)
framework
.
Failf
(
"Region not found; zone: %s"
,
zone
)
...
@@ -92,7 +88,7 @@ func findRegionForZone(zone string) string {
...
@@ -92,7 +88,7 @@ func findRegionForZone(zone string) string {
func
findZonesForRegion
(
region
string
)
[]
string
{
func
findZonesForRegion
(
region
string
)
[]
string
{
output
,
err
:=
exec
.
Command
(
"gcloud"
,
"compute"
,
"zones"
,
"list"
,
"--filter=region="
+
region
,
output
,
err
:=
exec
.
Command
(
"gcloud"
,
"compute"
,
"zones"
,
"list"
,
"--filter=region="
+
region
,
"--quiet"
,
"--format=[no-heading](name)"
)
.
CombinedOutput
()
"--quiet"
,
"--format=
csv
[no-heading](name)"
)
.
CombinedOutput
()
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
zones
:=
strings
.
Split
(
string
(
output
),
"
\n
"
)
zones
:=
strings
.
Split
(
string
(
output
),
"
\n
"
)
return
zones
return
zones
...
...
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