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
db4c86f5
Unverified
Commit
db4c86f5
authored
Oct 22, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70055 from bart0sh/PR0034-kubeadm-upgrade-misc-fixes
2 minor fixes for kubeadm upgrade
parents
7cbb9995
149fbe38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
apply.go
cmd/kubeadm/app/cmd/upgrade/apply.go
+5
-1
prepull.go
cmd/kubeadm/app/phases/upgrade/prepull.go
+1
-2
prepull_test.go
cmd/kubeadm/app/phases/upgrade/prepull_test.go
+3
-1
staticpods.go
cmd/kubeadm/app/phases/upgrade/staticpods.go
+1
-1
No files found.
cmd/kubeadm/app/cmd/upgrade/apply.go
View file @
db4c86f5
...
...
@@ -194,7 +194,11 @@ func RunApply(flags *applyFlags) error {
// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
glog
.
V
(
1
)
.
Infof
(
"[upgrade/apply] creating prepuller"
)
prepuller
:=
upgrade
.
NewDaemonSetPrepuller
(
upgradeVars
.
client
,
upgradeVars
.
waiter
,
&
upgradeVars
.
cfg
.
ClusterConfiguration
)
if
err
:=
upgrade
.
PrepullImagesInParallel
(
prepuller
,
flags
.
imagePullTimeout
);
err
!=
nil
{
componentsToPrepull
:=
constants
.
MasterComponents
if
upgradeVars
.
cfg
.
Etcd
.
External
!=
nil
{
componentsToPrepull
=
append
(
componentsToPrepull
,
constants
.
Etcd
)
}
if
err
:=
upgrade
.
PrepullImagesInParallel
(
prepuller
,
flags
.
imagePullTimeout
,
componentsToPrepull
);
err
!=
nil
{
return
fmt
.
Errorf
(
"[upgrade/prepull] Failed prepulled the images for the control plane components error: %v"
,
err
)
}
...
...
cmd/kubeadm/app/phases/upgrade/prepull.go
View file @
db4c86f5
...
...
@@ -91,8 +91,7 @@ func (d *DaemonSetPrepuller) DeleteFunc(component string) error {
}
// PrepullImagesInParallel creates DaemonSets synchronously but waits in parallel for the images to pull
func
PrepullImagesInParallel
(
kubePrepuller
Prepuller
,
timeout
time
.
Duration
)
error
{
componentsToPrepull
:=
append
(
constants
.
MasterComponents
,
constants
.
Etcd
)
func
PrepullImagesInParallel
(
kubePrepuller
Prepuller
,
timeout
time
.
Duration
,
componentsToPrepull
[]
string
)
error
{
fmt
.
Printf
(
"[upgrade/prepull] Will prepull images for components %v
\n
"
,
componentsToPrepull
)
timeoutChan
:=
time
.
After
(
timeout
)
...
...
cmd/kubeadm/app/phases/upgrade/prepull_test.go
View file @
db4c86f5
...
...
@@ -20,6 +20,8 @@ import (
"fmt"
"testing"
"time"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
//"k8s.io/apimachinery/pkg/util/version"
)
...
...
@@ -133,7 +135,7 @@ func TestPrepullImagesInParallel(t *testing.T) {
for
_
,
rt
:=
range
tests
{
actualErr
:=
PrepullImagesInParallel
(
rt
.
p
,
rt
.
timeout
)
actualErr
:=
PrepullImagesInParallel
(
rt
.
p
,
rt
.
timeout
,
append
(
constants
.
MasterComponents
,
constants
.
Etcd
)
)
if
(
actualErr
!=
nil
)
!=
rt
.
expectedErr
{
t
.
Errorf
(
"failed TestPrepullImagesInParallel
\n\t
expected error: %t
\n\t
got: %t"
,
...
...
cmd/kubeadm/app/phases/upgrade/staticpods.go
View file @
db4c86f5
...
...
@@ -226,7 +226,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP
if
waitForComponentRestart
{
fmt
.
Println
(
"[upgrade/staticpods] Waiting for the kubelet to restart the component"
)
fmt
.
Printf
(
"[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout %v
\n
"
,
UpgradeManifestTimeout
)
fmt
.
Printf
(
"[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout %v
)
\n
"
,
UpgradeManifestTimeout
)
// Wait for the mirror Pod hash to change; otherwise we'll run into race conditions here when the kubelet hasn't had time to
// notice the removal of the Static Pod, leading to a false positive below where we check that the API endpoint is healthy
...
...
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