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
61b9a21c
Commit
61b9a21c
authored
Mar 18, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23141 from yujuhong/fix_race
Auto commit by PR queue bot
parents
21df2aac
deafa44d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
config.go
pkg/kubelet/config/config.go
+1
-10
config_test.go
pkg/kubelet/config/config_test.go
+0
-3
kubelet.go
pkg/kubelet/kubelet.go
+4
-0
No files found.
pkg/kubelet/config/config.go
View file @
61b9a21c
...
@@ -238,16 +238,7 @@ func (s *podStorage) merge(source string, change interface{}) (adds, updates, de
...
@@ -238,16 +238,7 @@ func (s *podStorage) merge(source string, change interface{}) (adds, updates, de
}
}
recordFirstSeenTime
(
ref
)
recordFirstSeenTime
(
ref
)
pods
[
name
]
=
ref
pods
[
name
]
=
ref
// If a pod is not found in the cache, and it's also not in the
addPods
=
append
(
addPods
,
ref
)
// pending phase, it implies that kubelet may have restarted.
// Treat this pod as update so that kubelet wouldn't reject the
// pod in the admission process.
if
ref
.
Status
.
Phase
!=
api
.
PodPending
{
updatePods
=
append
(
updatePods
,
ref
)
}
else
{
// this is an add
addPods
=
append
(
addPods
,
ref
)
}
}
}
}
}
...
...
pkg/kubelet/config/config_test.go
View file @
61b9a21c
...
@@ -74,9 +74,6 @@ func CreateValidPod(name, namespace string) *api.Pod {
...
@@ -74,9 +74,6 @@ func CreateValidPod(name, namespace string) *api.Pod {
},
},
},
},
},
},
Status
:
api
.
PodStatus
{
Phase
:
api
.
PodPending
,
},
}
}
}
}
...
...
pkg/kubelet/kubelet.go
View file @
61b9a21c
...
@@ -2386,6 +2386,10 @@ func (kl *Kubelet) syncLoopIteration(updates <-chan kubetypes.PodUpdate, handler
...
@@ -2386,6 +2386,10 @@ func (kl *Kubelet) syncLoopIteration(updates <-chan kubetypes.PodUpdate, handler
switch
u
.
Op
{
switch
u
.
Op
{
case
kubetypes
.
ADD
:
case
kubetypes
.
ADD
:
glog
.
V
(
2
)
.
Infof
(
"SyncLoop (ADD, %q): %q"
,
u
.
Source
,
format
.
Pods
(
u
.
Pods
))
glog
.
V
(
2
)
.
Infof
(
"SyncLoop (ADD, %q): %q"
,
u
.
Source
,
format
.
Pods
(
u
.
Pods
))
// After restarting, kubelet will get all existing pods through
// ADD as if they are new pods. These pods will then go through the
// admission process and *may* be rejcted. This can be resolved
// once we have checkpointing.
handler
.
HandlePodAdditions
(
u
.
Pods
)
handler
.
HandlePodAdditions
(
u
.
Pods
)
case
kubetypes
.
UPDATE
:
case
kubetypes
.
UPDATE
:
glog
.
V
(
2
)
.
Infof
(
"SyncLoop (UPDATE, %q): %q"
,
u
.
Source
,
format
.
Pods
(
u
.
Pods
))
glog
.
V
(
2
)
.
Infof
(
"SyncLoop (UPDATE, %q): %q"
,
u
.
Source
,
format
.
Pods
(
u
.
Pods
))
...
...
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