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
4a37e056
Commit
4a37e056
authored
Apr 16, 2018
by
leigh schrandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[kubeadm] Update test-case, fix nil-pointer bug, and improve error message
parent
99a11436
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
constants.go
cmd/kubeadm/app/constants/constants.go
+1
-1
constants_test.go
cmd/kubeadm/app/constants/constants_test.go
+1
-1
staticpods.go
cmd/kubeadm/app/phases/upgrade/staticpods.go
+2
-2
staticpods_test.go
cmd/kubeadm/app/phases/upgrade/staticpods_test.go
+2
-2
No files found.
cmd/kubeadm/app/constants/constants.go
View file @
4a37e056
...
...
@@ -313,7 +313,7 @@ func EtcdSupportedVersion(versionString string) (*version.Version, error) {
}
return
etcdVersion
,
nil
}
return
nil
,
fmt
.
Errorf
(
"Unsupported or unknown kubernetes version
"
)
return
nil
,
fmt
.
Errorf
(
"Unsupported or unknown kubernetes version
(%v)"
,
kubernetesVersion
)
}
// GetStaticPodDirectory returns the location on the disk where the Static Pod should be present
...
...
cmd/kubeadm/app/constants/constants_test.go
View file @
4a37e056
...
...
@@ -124,7 +124,7 @@ func TestEtcdSupportedVersion(t *testing.T) {
{
kubernetesVersion
:
"1.99.0"
,
expectedVersion
:
nil
,
expectedError
:
fmt
.
Errorf
(
"Unsupported or unknown kubernetes version"
),
expectedError
:
fmt
.
Errorf
(
"Unsupported or unknown kubernetes version
(1.99.0)
"
),
},
{
kubernetesVersion
:
"1.9.0"
,
...
...
cmd/kubeadm/app/phases/upgrade/staticpods.go
View file @
4a37e056
...
...
@@ -222,11 +222,11 @@ func performEtcdStaticPodUpgrade(waiter apiclient.Waiter, pathMgr StaticPodPathM
// Need to check currently used version and version from constants, if differs then upgrade
desiredEtcdVersion
,
err
:=
constants
.
EtcdSupportedVersion
(
cfg
.
KubernetesVersion
)
if
err
!=
nil
{
return
true
,
fmt
.
Errorf
(
"failed to
parse the desired etcd version(%s): %v"
,
desiredEtcdVersion
.
String
()
,
err
)
return
true
,
fmt
.
Errorf
(
"failed to
retrieve an etcd version for the target kubernetes version: %v"
,
err
)
}
currentEtcdVersion
,
err
:=
version
.
ParseSemantic
(
etcdStatus
.
Version
)
if
err
!=
nil
{
return
true
,
fmt
.
Errorf
(
"failed to parse the current etcd version(%s): %v"
,
currentEtcdVersion
.
String
()
,
err
)
return
true
,
fmt
.
Errorf
(
"failed to parse the current etcd version(%s): %v"
,
etcdStatus
.
Version
,
err
)
}
// Comparing current etcd version with desired to catch the same version or downgrade condition and fail on them.
...
...
cmd/kubeadm/app/phases/upgrade/staticpods_test.go
View file @
4a37e056
...
...
@@ -368,7 +368,7 @@ func TestStaticPodControlPlane(t *testing.T) {
}
defer
os
.
RemoveAll
(
tmpEtcdDataDir
)
oldcfg
,
err
:=
getConfig
(
"v1.
7.0"
,
tempCerts
Dir
)
oldcfg
,
err
:=
getConfig
(
"v1.
9.0"
,
tempCertsDir
,
tmpEtcdData
Dir
)
if
err
!=
nil
{
t
.
Fatalf
(
"couldn't create config: %v"
,
err
)
}
...
...
@@ -410,7 +410,7 @@ func TestStaticPodControlPlane(t *testing.T) {
t
.
Fatalf
(
"couldn't read temp file: %v"
,
err
)
}
newcfg
,
err
:=
getConfig
(
"v1.
8.0"
,
tempCerts
Dir
)
newcfg
,
err
:=
getConfig
(
"v1.
10.0"
,
tempCertsDir
,
tmpEtcdData
Dir
)
if
err
!=
nil
{
t
.
Fatalf
(
"couldn't create config: %v"
,
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