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
3b5bf39c
Commit
3b5bf39c
authored
Dec 16, 2016
by
Kris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support different image during GCE node upgrade
parent
853fcc39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
nodes_util.go
test/e2e/framework/nodes_util.go
+8
-3
util.go
test/e2e/framework/util.go
+8
-0
No files found.
test/e2e/framework/nodes_util.go
View file @
3b5bf39c
...
@@ -18,6 +18,7 @@ package framework
...
@@ -18,6 +18,7 @@ package framework
import
(
import
(
"fmt"
"fmt"
"os"
"path"
"path"
"strings"
"strings"
"time"
"time"
...
@@ -66,8 +67,7 @@ var NodeUpgrade = func(f *Framework, v string, img string) error {
...
@@ -66,8 +67,7 @@ var NodeUpgrade = func(f *Framework, v string, img string) error {
var
err
error
var
err
error
switch
TestContext
.
Provider
{
switch
TestContext
.
Provider
{
case
"gce"
:
case
"gce"
:
// TODO(maisem): add GCE support for upgrading to different images.
err
=
nodeUpgradeGCE
(
v
,
img
)
err
=
nodeUpgradeGCE
(
v
)
case
"gke"
:
case
"gke"
:
err
=
nodeUpgradeGKE
(
v
,
img
)
err
=
nodeUpgradeGKE
(
v
,
img
)
default
:
default
:
...
@@ -88,8 +88,13 @@ var NodeUpgrade = func(f *Framework, v string, img string) error {
...
@@ -88,8 +88,13 @@ var NodeUpgrade = func(f *Framework, v string, img string) error {
return
nil
return
nil
}
}
func
nodeUpgradeGCE
(
rawV
string
)
error
{
func
nodeUpgradeGCE
(
rawV
,
img
string
)
error
{
v
:=
"v"
+
rawV
v
:=
"v"
+
rawV
if
img
!=
""
{
env
:=
append
(
os
.
Environ
(),
"KUBE_NODE_OS_DISTRIBUTION="
+
img
)
_
,
_
,
err
:=
RunCmdEnv
(
env
,
path
.
Join
(
TestContext
.
RepoRoot
,
"cluster/gce/upgrade.sh"
),
"-N"
,
"-o"
,
v
)
return
err
}
_
,
_
,
err
:=
RunCmd
(
path
.
Join
(
TestContext
.
RepoRoot
,
"cluster/gce/upgrade.sh"
),
"-N"
,
v
)
_
,
_
,
err
:=
RunCmd
(
path
.
Join
(
TestContext
.
RepoRoot
,
"cluster/gce/upgrade.sh"
),
"-N"
,
v
)
return
err
return
err
}
}
...
...
test/e2e/framework/util.go
View file @
3b5bf39c
...
@@ -4846,6 +4846,13 @@ func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[strin
...
@@ -4846,6 +4846,13 @@ func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[strin
// RunCmd runs cmd using args and returns its stdout and stderr. It also outputs
// RunCmd runs cmd using args and returns its stdout and stderr. It also outputs
// cmd's stdout and stderr to their respective OS streams.
// cmd's stdout and stderr to their respective OS streams.
func
RunCmd
(
command
string
,
args
...
string
)
(
string
,
string
,
error
)
{
func
RunCmd
(
command
string
,
args
...
string
)
(
string
,
string
,
error
)
{
return
RunCmdEnv
(
nil
,
command
,
args
...
)
}
// RunCmdEnv runs cmd with the provided environment and args and
// returns its stdout and stderr. It also outputs cmd's stdout and
// stderr to their respective OS streams.
func
RunCmdEnv
(
env
[]
string
,
command
string
,
args
...
string
)
(
string
,
string
,
error
)
{
Logf
(
"Running %s %v"
,
command
,
args
)
Logf
(
"Running %s %v"
,
command
,
args
)
var
bout
,
berr
bytes
.
Buffer
var
bout
,
berr
bytes
.
Buffer
cmd
:=
exec
.
Command
(
command
,
args
...
)
cmd
:=
exec
.
Command
(
command
,
args
...
)
...
@@ -4856,6 +4863,7 @@ func RunCmd(command string, args ...string) (string, string, error) {
...
@@ -4856,6 +4863,7 @@ func RunCmd(command string, args ...string) (string, string, error) {
// newlines.
// newlines.
cmd
.
Stdout
=
io
.
MultiWriter
(
os
.
Stdout
,
&
bout
)
cmd
.
Stdout
=
io
.
MultiWriter
(
os
.
Stdout
,
&
bout
)
cmd
.
Stderr
=
io
.
MultiWriter
(
os
.
Stderr
,
&
berr
)
cmd
.
Stderr
=
io
.
MultiWriter
(
os
.
Stderr
,
&
berr
)
cmd
.
Env
=
env
err
:=
cmd
.
Run
()
err
:=
cmd
.
Run
()
stdout
,
stderr
:=
bout
.
String
(),
berr
.
String
()
stdout
,
stderr
:=
bout
.
String
(),
berr
.
String
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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