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
00552765
Commit
00552765
authored
Jul 04, 2018
by
Xianglin Gao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case
Signed-off-by:
Xianglin Gao
<
xianglin.gxl@alibaba-inc.com
>
parent
d9a5a04f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
plan.go
cmd/kubeadm/app/cmd/upgrade/plan.go
+7
-2
plan_test.go
cmd/kubeadm/app/cmd/upgrade/plan_test.go
+2
-2
No files found.
cmd/kubeadm/app/cmd/upgrade/plan.go
View file @
00552765
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
"io"
"io"
"os"
"os"
"sort"
"sort"
"strings"
"text/tabwriter"
"text/tabwriter"
"github.com/golang/glog"
"github.com/golang/glog"
...
@@ -156,7 +157,11 @@ func printAvailableUpgrades(upgrades []upgrade.Upgrade, w io.Writer, isExternalE
...
@@ -156,7 +157,11 @@ func printAvailableUpgrades(upgrades []upgrade.Upgrade, w io.Writer, isExternalE
UnstableVersionFlag
:=
""
UnstableVersionFlag
:=
""
if
len
(
newK8sVersion
.
PreRelease
())
!=
0
{
if
len
(
newK8sVersion
.
PreRelease
())
!=
0
{
UnstableVersionFlag
=
"--allow-experimental-upgrades"
if
strings
.
HasPrefix
(
newK8sVersion
.
PreRelease
(),
"rc"
)
{
UnstableVersionFlag
=
" --allow-release-candidate-upgrades"
}
else
{
UnstableVersionFlag
=
" --allow-experimental-upgrades"
}
}
}
if
isExternalEtcd
&&
upgrade
.
CanUpgradeEtcd
()
{
if
isExternalEtcd
&&
upgrade
.
CanUpgradeEtcd
()
{
...
@@ -238,7 +243,7 @@ func printAvailableUpgrades(upgrades []upgrade.Upgrade, w io.Writer, isExternalE
...
@@ -238,7 +243,7 @@ func printAvailableUpgrades(upgrades []upgrade.Upgrade, w io.Writer, isExternalE
fmt
.
Fprintln
(
w
,
""
)
fmt
.
Fprintln
(
w
,
""
)
fmt
.
Fprintln
(
w
,
"You can now apply the upgrade by executing the following command:"
)
fmt
.
Fprintln
(
w
,
"You can now apply the upgrade by executing the following command:"
)
fmt
.
Fprintln
(
w
,
""
)
fmt
.
Fprintln
(
w
,
""
)
fmt
.
Fprintf
(
w
,
"
\t
kubeadm upgrade apply %s
%s
\n
"
,
upgrade
.
After
.
KubeVersion
,
UnstableVersionFlag
)
fmt
.
Fprintf
(
w
,
"
\t
kubeadm upgrade apply %s%s
\n
"
,
upgrade
.
After
.
KubeVersion
,
UnstableVersionFlag
)
fmt
.
Fprintln
(
w
,
""
)
fmt
.
Fprintln
(
w
,
""
)
if
upgrade
.
Before
.
KubeadmVersion
!=
upgrade
.
After
.
KubeadmVersion
{
if
upgrade
.
Before
.
KubeadmVersion
!=
upgrade
.
After
.
KubeadmVersion
{
...
...
cmd/kubeadm/app/cmd/upgrade/plan_test.go
View file @
00552765
...
@@ -302,7 +302,7 @@ Etcd 3.0.17 3.1.12
...
@@ -302,7 +302,7 @@ Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.9.0-beta.1
kubeadm upgrade apply v1.9.0-beta.1
--allow-experimental-upgrades
Note: Before you can perform this upgrade, you have to update kubeadm to v1.9.0-beta.1.
Note: Before you can perform this upgrade, you have to update kubeadm to v1.9.0-beta.1.
...
@@ -350,7 +350,7 @@ Etcd 3.0.17 3.1.12
...
@@ -350,7 +350,7 @@ Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.9.0-rc.1
kubeadm upgrade apply v1.9.0-rc.1
--allow-release-candidate-upgrades
Note: Before you can perform this upgrade, you have to update kubeadm to v1.9.0-rc.1.
Note: Before you can perform this upgrade, you have to update kubeadm to v1.9.0-rc.1.
...
...
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