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
5429d15f
Commit
5429d15f
authored
Dec 15, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18449 from timstclair/race
Auto commit by PR queue bot
parents
6f2351b9
24644251
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
kubelet.go
pkg/kubelet/kubelet.go
+2
-1
fake_manager.go
pkg/kubelet/prober/fake_manager.go
+1
-0
manager.go
pkg/kubelet/prober/manager.go
+8
-3
manager_test.go
pkg/kubelet/prober/manager_test.go
+1
-0
No files found.
pkg/kubelet/kubelet.go
View file @
5429d15f
...
@@ -905,8 +905,9 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
...
@@ -905,8 +905,9 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
// handled by pod workers).
// handled by pod workers).
go
util
.
Until
(
kl
.
podKiller
,
1
*
time
.
Second
,
util
.
NeverStop
)
go
util
.
Until
(
kl
.
podKiller
,
1
*
time
.
Second
,
util
.
NeverStop
)
//
Run the system oom watcher forever
.
//
Start component sync loops
.
kl
.
statusManager
.
Start
()
kl
.
statusManager
.
Start
()
kl
.
probeManager
.
Start
()
// Start the pod lifecycle event generator.
// Start the pod lifecycle event generator.
kl
.
pleg
.
Start
()
kl
.
pleg
.
Start
()
kl
.
syncLoop
(
updates
,
kl
)
kl
.
syncLoop
(
updates
,
kl
)
...
...
pkg/kubelet/prober/fake_manager.go
View file @
5429d15f
...
@@ -29,6 +29,7 @@ var _ Manager = FakeManager{}
...
@@ -29,6 +29,7 @@ var _ Manager = FakeManager{}
func
(
_
FakeManager
)
AddPod
(
_
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
AddPod
(
_
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
RemovePod
(
_
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
RemovePod
(
_
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
CleanupPods
(
_
[]
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
CleanupPods
(
_
[]
*
api
.
Pod
)
{}
func
(
_
FakeManager
)
Start
()
{}
func
(
_
FakeManager
)
UpdatePodStatus
(
_
types
.
UID
,
podStatus
*
api
.
PodStatus
)
{
func
(
_
FakeManager
)
UpdatePodStatus
(
_
types
.
UID
,
podStatus
*
api
.
PodStatus
)
{
for
i
:=
range
podStatus
.
ContainerStatuses
{
for
i
:=
range
podStatus
.
ContainerStatuses
{
...
...
pkg/kubelet/prober/manager.go
View file @
5429d15f
...
@@ -52,6 +52,9 @@ type Manager interface {
...
@@ -52,6 +52,9 @@ type Manager interface {
// UpdatePodStatus modifies the given PodStatus with the appropriate Ready state for each
// UpdatePodStatus modifies the given PodStatus with the appropriate Ready state for each
// container based on container running status, cached probe results and worker states.
// container based on container running status, cached probe results and worker states.
UpdatePodStatus
(
types
.
UID
,
*
api
.
PodStatus
)
UpdatePodStatus
(
types
.
UID
,
*
api
.
PodStatus
)
// Start starts the Manager sync loops.
Start
()
}
}
type
manager
struct
{
type
manager
struct
{
...
@@ -79,20 +82,22 @@ func NewManager(
...
@@ -79,20 +82,22 @@ func NewManager(
runner
kubecontainer
.
ContainerCommandRunner
,
runner
kubecontainer
.
ContainerCommandRunner
,
refManager
*
kubecontainer
.
RefManager
,
refManager
*
kubecontainer
.
RefManager
,
recorder
record
.
EventRecorder
)
Manager
{
recorder
record
.
EventRecorder
)
Manager
{
prober
:=
newProber
(
runner
,
refManager
,
recorder
)
prober
:=
newProber
(
runner
,
refManager
,
recorder
)
readinessManager
:=
results
.
NewManager
()
readinessManager
:=
results
.
NewManager
()
m
:=
&
manager
{
return
&
manager
{
statusManager
:
statusManager
,
statusManager
:
statusManager
,
prober
:
prober
,
prober
:
prober
,
readinessManager
:
readinessManager
,
readinessManager
:
readinessManager
,
livenessManager
:
livenessManager
,
livenessManager
:
livenessManager
,
workers
:
make
(
map
[
probeKey
]
*
worker
),
workers
:
make
(
map
[
probeKey
]
*
worker
),
}
}
}
// Start syncing probe status. This should only be called once.
func
(
m
*
manager
)
Start
()
{
// Start syncing readiness.
// Start syncing readiness.
go
util
.
Forever
(
m
.
updateReadiness
,
0
)
go
util
.
Forever
(
m
.
updateReadiness
,
0
)
return
m
}
}
// Key uniquely identifying container probes
// Key uniquely identifying container probes
...
...
pkg/kubelet/prober/manager_test.go
View file @
5429d15f
...
@@ -251,6 +251,7 @@ func TestUpdatePodStatus(t *testing.T) {
...
@@ -251,6 +251,7 @@ func TestUpdatePodStatus(t *testing.T) {
func
TestUpdateReadiness
(
t
*
testing
.
T
)
{
func
TestUpdateReadiness
(
t
*
testing
.
T
)
{
testPod
:=
getTestPod
(
readiness
,
api
.
Probe
{})
testPod
:=
getTestPod
(
readiness
,
api
.
Probe
{})
m
:=
newTestManager
()
m
:=
newTestManager
()
m
.
Start
()
m
.
statusManager
.
SetPodStatus
(
&
testPod
,
getTestRunningStatus
())
m
.
statusManager
.
SetPodStatus
(
&
testPod
,
getTestRunningStatus
())
m
.
AddPod
(
&
testPod
)
m
.
AddPod
(
&
testPod
)
...
...
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