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
bba84d78
Unverified
Commit
bba84d78
authored
Dec 13, 2017
by
Anthony Yeh
Committed by
GitHub
Dec 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #57121 from enisoc/gce-upgrade-warning
gce/upgrade.sh: Prompt if etcd version is unspecified.
parents
73bb9810
bbcf59bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
upgrade.sh
cluster/gce/upgrade.sh
+33
-0
nodes_util.go
test/e2e/framework/nodes_util.go
+4
-0
No files found.
cluster/gce/upgrade.sh
View file @
bba84d78
...
@@ -537,6 +537,39 @@ if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]] && [[ "${STORAGE_BACKEND:-}" != "etcd2" ]]
...
@@ -537,6 +537,39 @@ if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]] && [[ "${STORAGE_BACKEND:-}" != "etcd2" ]]
fi
fi
fi
fi
# Prompt if etcd image/version is unspecified when doing master upgrade.
# In e2e tests, we use TEST_ALLOW_IMPLICIT_ETCD_UPGRADE=true to skip this
# prompt, simulating the behavior when the user confirms interactively.
# All other automated use of this script should explicitly specify a version.
if
[[
"
${
master_upgrade
}
"
==
"true"
]]
;
then
if
[[
-z
"
${
ETCD_IMAGE
:-}
"
&&
-z
"
${
TEST_ETCD_IMAGE
:-}
"
]]
||
[[
-z
"
${
ETCD_VERSION
:-}
"
&&
-z
"
${
TEST_ETCD_VERSION
:-}
"
]]
;
then
echo
echo
"***WARNING***"
echo
"Upgrading Kubernetes with this script might result in an upgrade to a new etcd version."
echo
"Some etcd version upgrades, such as 3.0.x to 3.1.x, DO NOT offer a downgrade path."
echo
"To pin the etcd version to your current one (e.g. v3.0.17), set the following variables"
echo
"before running this script:"
echo
echo
"# example: pin to etcd v3.0.17"
echo
"export ETCD_IMAGE=3.0.17"
echo
"export ETCD_VERSION=3.0.17"
echo
echo
"Alternatively, if you choose to allow an etcd upgrade that doesn't support downgrade,"
echo
"you might still be able to downgrade Kubernetes by pinning to the newer etcd version."
echo
"In all cases, it is strongly recommended to have an etcd backup before upgrading."
echo
if
[
-t
0
]
&&
[
-t
1
]
;
then
read
-p
"Continue with default etcd version, which might upgrade etcd? [y/N] "
confirm
if
[[
"
${
confirm
}
"
!=
"y"
]]
;
then
exit
1
fi
elif
[[
"
${
TEST_ALLOW_IMPLICIT_ETCD_UPGRADE
:-}
"
!=
"true"
]]
;
then
echo
"ETCD_IMAGE and ETCD_VERSION must be specified when run non-interactively."
>
&2
exit
1
fi
fi
fi
print-node-version-info
"Pre-Upgrade"
print-node-version-info
"Pre-Upgrade"
if
[[
"
${
local_binaries
}
"
==
"false"
]]
;
then
if
[[
"
${
local_binaries
}
"
==
"false"
]]
;
then
...
...
test/e2e/framework/nodes_util.go
View file @
bba84d78
...
@@ -78,6 +78,10 @@ func masterUpgradeGCE(rawV string, enableKubeProxyDaemonSet bool) error {
...
@@ -78,6 +78,10 @@ func masterUpgradeGCE(rawV string, enableKubeProxyDaemonSet bool) error {
"TEST_ETCD_VERSION="
+
TestContext
.
EtcdUpgradeVersion
,
"TEST_ETCD_VERSION="
+
TestContext
.
EtcdUpgradeVersion
,
"STORAGE_BACKEND="
+
TestContext
.
EtcdUpgradeStorage
,
"STORAGE_BACKEND="
+
TestContext
.
EtcdUpgradeStorage
,
"TEST_ETCD_IMAGE=3.1.10"
)
"TEST_ETCD_IMAGE=3.1.10"
)
}
else
{
// In e2e tests, we skip the confirmation prompt about
// implicit etcd upgrades to simulate the user entering "y".
env
=
append
(
env
,
"TEST_ALLOW_IMPLICIT_ETCD_UPGRADE=true"
)
}
}
v
:=
"v"
+
rawV
v
:=
"v"
+
rawV
...
...
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