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
e0d9ccde
Commit
e0d9ccde
authored
Dec 07, 2015
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor clean up on checking container runtime status
Remove redundant function and consolidate the code.
parent
33eda2ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
22 deletions
+5
-22
kubelet.go
pkg/kubelet/kubelet.go
+5
-22
No files found.
pkg/kubelet/kubelet.go
View file @
e0d9ccde
...
@@ -143,20 +143,6 @@ type SyncHandler interface {
...
@@ -143,20 +143,6 @@ type SyncHandler interface {
type
SourcesReadyFn
func
(
sourcesSeen
sets
.
String
)
bool
type
SourcesReadyFn
func
(
sourcesSeen
sets
.
String
)
bool
// Wait for the container runtime to be up with a timeout.
func
waitUntilRuntimeIsUp
(
cr
kubecontainer
.
Runtime
,
timeout
time
.
Duration
)
error
{
var
err
error
=
nil
waitStart
:=
time
.
Now
()
for
time
.
Since
(
waitStart
)
<
timeout
{
_
,
err
=
cr
.
Version
()
if
err
==
nil
{
return
nil
}
time
.
Sleep
(
100
*
time
.
Millisecond
)
}
return
err
}
// New instantiates a new Kubelet object along with all the required internal modules.
// New instantiates a new Kubelet object along with all the required internal modules.
// No initialization of Kubelet and its modules should happen here.
// No initialization of Kubelet and its modules should happen here.
func
NewMainKubelet
(
func
NewMainKubelet
(
...
@@ -2583,15 +2569,12 @@ func (kl *Kubelet) GetPodByName(namespace, name string) (*api.Pod, bool) {
...
@@ -2583,15 +2569,12 @@ func (kl *Kubelet) GetPodByName(namespace, name string) (*api.Pod, bool) {
}
}
func
(
kl
*
Kubelet
)
updateRuntimeUp
()
{
func
(
kl
*
Kubelet
)
updateRuntimeUp
()
{
start
:=
time
.
Now
()
if
_
,
err
:=
kl
.
containerRuntime
.
Version
();
err
!=
nil
{
err
:=
waitUntilRuntimeIsUp
(
kl
.
containerRuntime
,
100
*
time
.
Millisecond
)
glog
.
Errorf
(
"Container runtime sanity check failed: %v"
,
err
)
if
err
==
nil
{
return
// Errors in initialization will be synchronized internally.
kl
.
oneTimeInitializer
.
Do
(
kl
.
initializeRuntimeDependentModules
)
kl
.
runtimeState
.
setRuntimeSync
(
time
.
Now
())
}
else
{
glog
.
Errorf
(
"Container runtime sanity check failed after %v, err: %v"
,
time
.
Since
(
start
),
err
)
}
}
kl
.
oneTimeInitializer
.
Do
(
kl
.
initializeRuntimeDependentModules
)
kl
.
runtimeState
.
setRuntimeSync
(
time
.
Now
())
}
}
func
(
kl
*
Kubelet
)
reconcileCBR0
(
podCIDR
string
)
error
{
func
(
kl
*
Kubelet
)
reconcileCBR0
(
podCIDR
string
)
error
{
...
...
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