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
875c1a70
Commit
875c1a70
authored
Mar 09, 2018
by
wojtekt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix upgrade tests for GKE Regional Clusters
parent
a0844c17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
nodes_util.go
test/e2e/framework/nodes_util.go
+23
-5
No files found.
test/e2e/framework/nodes_util.go
View file @
875c1a70
...
...
@@ -119,17 +119,35 @@ func masterUpgradeGCE(rawV string, enableKubeProxyDaemonSet bool) error {
return
err
}
func
locationParamGKE
()
string
{
if
TestContext
.
CloudConfig
.
Zone
!=
""
{
return
fmt
.
Sprintf
(
"--zone=%s"
,
TestContext
.
CloudConfig
.
Zone
)
}
return
fmt
.
Sprintf
(
"--region=%s"
,
TestContext
.
CloudConfig
.
Region
)
}
func
appendContainerCommandGroupIfNeeded
(
args
[]
string
)
[]
string
{
if
TestContext
.
CloudConfig
.
Region
!=
""
{
// TODO(wojtek-t): Get rid of it once Regional Clusters go to GA.
return
append
([]
string
{
"beta"
},
args
...
)
}
return
args
}
func
masterUpgradeGKE
(
v
string
)
error
{
Logf
(
"Upgrading master to %q"
,
v
)
_
,
_
,
err
:=
RunCmd
(
"gcloud"
,
"container"
,
args
:=
[]
string
{
"container"
,
"clusters"
,
fmt
.
Sprintf
(
"--project=%s"
,
TestContext
.
CloudConfig
.
ProjectID
),
fmt
.
Sprintf
(
"--zone=%s"
,
TestContext
.
CloudConfig
.
Zone
),
locationParamGKE
(
),
"upgrade"
,
TestContext
.
CloudConfig
.
Cluster
,
"--master"
,
fmt
.
Sprintf
(
"--cluster-version=%s"
,
v
),
"--quiet"
)
"--quiet"
,
}
_
,
_
,
err
:=
RunCmd
(
"gcloud"
,
appendContainerCommandGroupIfNeeded
(
args
)
...
)
if
err
!=
nil
{
return
err
}
...
...
@@ -235,7 +253,7 @@ func nodeUpgradeGKE(v string, img string) error {
"container"
,
"clusters"
,
fmt
.
Sprintf
(
"--project=%s"
,
TestContext
.
CloudConfig
.
ProjectID
),
fmt
.
Sprintf
(
"--zone=%s"
,
TestContext
.
CloudConfig
.
Zone
),
locationParamGKE
(
),
"upgrade"
,
TestContext
.
CloudConfig
.
Cluster
,
fmt
.
Sprintf
(
"--cluster-version=%s"
,
v
),
...
...
@@ -244,7 +262,7 @@ func nodeUpgradeGKE(v string, img string) error {
if
len
(
img
)
>
0
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--image-type=%s"
,
img
))
}
_
,
_
,
err
:=
RunCmd
(
"gcloud"
,
a
rgs
...
)
_
,
_
,
err
:=
RunCmd
(
"gcloud"
,
a
ppendContainerCommandGroupIfNeeded
(
args
)
...
)
if
err
!=
nil
{
return
err
...
...
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