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
b6d846ae
Commit
b6d846ae
authored
Apr 08, 2015
by
Dawn Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small cleanup by removing useless generatePodStatus
parent
75bfcf2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
kubelet.go
pkg/kubelet/kubelet.go
+8
-8
No files found.
pkg/kubelet/kubelet.go
View file @
b6d846ae
...
@@ -1126,7 +1126,11 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
...
@@ -1126,7 +1126,11 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
// Do not use the cache here since we need the newest status to check
// Do not use the cache here since we need the newest status to check
// if we need to restart the container below.
// if we need to restart the container below.
podStatus
,
err
:=
kl
.
generatePodStatus
(
podFullName
)
pod
,
found
:=
kl
.
GetPodByFullName
(
podFullName
)
if
!
found
{
return
podContainerChangesSpec
{},
fmt
.
Errorf
(
"couldn't find pod %q"
,
podFullName
)
}
podStatus
,
err
:=
kl
.
generatePodStatus
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Unable to get pod with name %q and uid %q info with error(%v)"
,
podFullName
,
uid
,
err
)
glog
.
Errorf
(
"Unable to get pod with name %q and uid %q info with error(%v)"
,
podFullName
,
uid
,
err
)
return
podContainerChangesSpec
{},
err
return
podContainerChangesSpec
{},
err
...
@@ -1238,7 +1242,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1238,7 +1242,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
// exist yet.
// exist yet.
return
return
}
}
status
,
err
:=
kl
.
generatePodStatus
ByPod
(
pod
)
status
,
err
:=
kl
.
generatePodStatus
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Unable to generate status for pod with name %q and uid %q info with error(%v)"
,
podFullName
,
uid
,
err
)
glog
.
Errorf
(
"Unable to generate status for pod with name %q and uid %q info with error(%v)"
,
podFullName
,
uid
,
err
)
}
else
{
}
else
{
...
@@ -1937,20 +1941,16 @@ func (kl *Kubelet) GetPodStatus(podFullName string) (api.PodStatus, error) {
...
@@ -1937,20 +1941,16 @@ func (kl *Kubelet) GetPodStatus(podFullName string) (api.PodStatus, error) {
glog
.
V
(
3
)
.
Infof
(
"Returning cached status for %q"
,
podFullName
)
glog
.
V
(
3
)
.
Infof
(
"Returning cached status for %q"
,
podFullName
)
return
cachedPodStatus
,
nil
return
cachedPodStatus
,
nil
}
}
return
kl
.
generatePodStatus
(
podFullName
)
}
func
(
kl
*
Kubelet
)
generatePodStatus
(
podFullName
string
)
(
api
.
PodStatus
,
error
)
{
pod
,
found
:=
kl
.
GetPodByFullName
(
podFullName
)
pod
,
found
:=
kl
.
GetPodByFullName
(
podFullName
)
if
!
found
{
if
!
found
{
return
api
.
PodStatus
{},
fmt
.
Errorf
(
"couldn't find pod %q"
,
podFullName
)
return
api
.
PodStatus
{},
fmt
.
Errorf
(
"couldn't find pod %q"
,
podFullName
)
}
}
return
kl
.
generatePodStatus
ByPod
(
pod
)
return
kl
.
generatePodStatus
(
pod
)
}
}
// By passing the pod directly, this method avoids pod lookup, which requires
// By passing the pod directly, this method avoids pod lookup, which requires
// grabbing a lock.
// grabbing a lock.
func
(
kl
*
Kubelet
)
generatePodStatus
ByPod
(
pod
*
api
.
Pod
)
(
api
.
PodStatus
,
error
)
{
func
(
kl
*
Kubelet
)
generatePodStatus
(
pod
*
api
.
Pod
)
(
api
.
PodStatus
,
error
)
{
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
glog
.
V
(
3
)
.
Infof
(
"Generating status for %q"
,
podFullName
)
glog
.
V
(
3
)
.
Infof
(
"Generating status for %q"
,
podFullName
)
...
...
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