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
c6462555
Commit
c6462555
authored
Dec 07, 2015
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace podFullName with format.Pod() in logging messages
parent
fda73c04
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
61 deletions
+48
-61
helpers.go
pkg/kubelet/container/helpers.go
+5
-8
manager.go
pkg/kubelet/dockertools/manager.go
+23
-28
kubelet.go
pkg/kubelet/kubelet.go
+15
-18
rkt.go
pkg/kubelet/rkt/rkt.go
+2
-4
runonce.go
pkg/kubelet/runonce.go
+3
-3
No files found.
pkg/kubelet/container/helpers.go
View file @
c6462555
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/third_party/golang/expansion"
"k8s.io/kubernetes/third_party/golang/expansion"
...
@@ -44,8 +45,6 @@ type RunContainerOptionsGenerator interface {
...
@@ -44,8 +45,6 @@ type RunContainerOptionsGenerator interface {
// ShouldContainerBeRestarted checks whether a container needs to be restarted.
// ShouldContainerBeRestarted checks whether a container needs to be restarted.
// TODO(yifan): Think about how to refactor this.
// TODO(yifan): Think about how to refactor this.
func
ShouldContainerBeRestarted
(
container
*
api
.
Container
,
pod
*
api
.
Pod
,
podStatus
*
PodStatus
)
bool
{
func
ShouldContainerBeRestarted
(
container
*
api
.
Container
,
pod
*
api
.
Pod
,
podStatus
*
PodStatus
)
bool
{
podFullName
:=
GetPodFullName
(
pod
)
// Get all dead container status.
// Get all dead container status.
var
resultStatus
[]
*
ContainerStatus
var
resultStatus
[]
*
ContainerStatus
for
_
,
containerStatus
:=
range
podStatus
.
ContainerStatuses
{
for
_
,
containerStatus
:=
range
podStatus
.
ContainerStatuses
{
...
@@ -57,14 +56,14 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
...
@@ -57,14 +56,14 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
// Check RestartPolicy for dead container.
// Check RestartPolicy for dead container.
if
len
(
resultStatus
)
>
0
{
if
len
(
resultStatus
)
>
0
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyNever
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyNever
{
glog
.
V
(
4
)
.
Infof
(
"Already ran container %q of pod %q, do nothing"
,
container
.
Name
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Already ran container %q of pod %q, do nothing"
,
container
.
Name
,
format
.
Pod
(
pod
)
)
return
false
return
false
}
}
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyOnFailure
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyOnFailure
{
// Check the exit code of last run. Note: This assumes the result is sorted
// Check the exit code of last run. Note: This assumes the result is sorted
// by the created time in reverse order.
// by the created time in reverse order.
if
resultStatus
[
0
]
.
ExitCode
==
0
{
if
resultStatus
[
0
]
.
ExitCode
==
0
{
glog
.
V
(
4
)
.
Infof
(
"Already successfully ran container %q of pod %q, do nothing"
,
container
.
Name
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Already successfully ran container %q of pod %q, do nothing"
,
container
.
Name
,
format
.
Pod
(
pod
)
)
return
false
return
false
}
}
}
}
...
@@ -74,8 +73,6 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
...
@@ -74,8 +73,6 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
// TODO (random-liu) This should be removed soon after rkt implements GetPodStatus.
// TODO (random-liu) This should be removed soon after rkt implements GetPodStatus.
func
ShouldContainerBeRestartedOldVersion
(
container
*
api
.
Container
,
pod
*
api
.
Pod
,
podStatus
*
api
.
PodStatus
)
bool
{
func
ShouldContainerBeRestartedOldVersion
(
container
*
api
.
Container
,
pod
*
api
.
Pod
,
podStatus
*
api
.
PodStatus
)
bool
{
podFullName
:=
GetPodFullName
(
pod
)
// Get all dead container status.
// Get all dead container status.
var
resultStatus
[]
*
api
.
ContainerStatus
var
resultStatus
[]
*
api
.
ContainerStatus
for
i
,
containerStatus
:=
range
podStatus
.
ContainerStatuses
{
for
i
,
containerStatus
:=
range
podStatus
.
ContainerStatuses
{
...
@@ -87,14 +84,14 @@ func ShouldContainerBeRestartedOldVersion(container *api.Container, pod *api.Pod
...
@@ -87,14 +84,14 @@ func ShouldContainerBeRestartedOldVersion(container *api.Container, pod *api.Pod
// Check RestartPolicy for dead container.
// Check RestartPolicy for dead container.
if
len
(
resultStatus
)
>
0
{
if
len
(
resultStatus
)
>
0
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyNever
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyNever
{
glog
.
V
(
4
)
.
Infof
(
"Already ran container %q of pod %q, do nothing"
,
container
.
Name
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Already ran container %q of pod %q, do nothing"
,
container
.
Name
,
format
.
Pod
(
pod
)
)
return
false
return
false
}
}
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyOnFailure
{
if
pod
.
Spec
.
RestartPolicy
==
api
.
RestartPolicyOnFailure
{
// Check the exit code of last run. Note: This assumes the result is sorted
// Check the exit code of last run. Note: This assumes the result is sorted
// by the created time in reverse order.
// by the created time in reverse order.
if
resultStatus
[
0
]
.
State
.
Terminated
.
ExitCode
==
0
{
if
resultStatus
[
0
]
.
State
.
Terminated
.
ExitCode
==
0
{
glog
.
V
(
4
)
.
Infof
(
"Already successfully ran container %q of pod %q, do nothing"
,
container
.
Name
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Already successfully ran container %q of pod %q, do nothing"
,
container
.
Name
,
format
.
Pod
(
pod
)
)
return
false
return
false
}
}
}
}
...
...
pkg/kubelet/dockertools/manager.go
View file @
c6462555
This diff is collapsed.
Click to expand it.
pkg/kubelet/kubelet.go
View file @
c6462555
...
@@ -1583,8 +1583,6 @@ func (kl *Kubelet) makePodDataDirs(pod *api.Pod) error {
...
@@ -1583,8 +1583,6 @@ func (kl *Kubelet) makePodDataDirs(pod *api.Pod) error {
}
}
func
(
kl
*
Kubelet
)
syncPod
(
pod
*
api
.
Pod
,
mirrorPod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
updateType
kubetypes
.
SyncPodType
)
(
syncErr
error
)
{
func
(
kl
*
Kubelet
)
syncPod
(
pod
*
api
.
Pod
,
mirrorPod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
updateType
kubetypes
.
SyncPodType
)
(
syncErr
error
)
{
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
uid
:=
pod
.
UID
start
:=
time
.
Now
()
start
:=
time
.
Now
()
var
firstSeenTime
time
.
Time
var
firstSeenTime
time
.
Time
if
firstSeenTimeStr
,
ok
:=
pod
.
Annotations
[
kubetypes
.
ConfigFirstSeenAnnotationKey
];
!
ok
{
if
firstSeenTimeStr
,
ok
:=
pod
.
Annotations
[
kubetypes
.
ConfigFirstSeenAnnotationKey
];
!
ok
{
...
@@ -1597,7 +1595,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1597,7 +1595,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
defer
func
()
{
defer
func
()
{
status
,
err
:=
kl
.
generatePodStatus
(
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
%q with error(%v)"
,
format
.
Pod
(
pod
)
,
err
)
// Propagate the error upstream.
// Propagate the error upstream.
syncErr
=
err
syncErr
=
err
}
else
{
}
else
{
...
@@ -1620,18 +1618,19 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1620,18 +1618,19 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
// Create Mirror Pod for Static Pod if it doesn't already exist
// Create Mirror Pod for Static Pod if it doesn't already exist
if
kubepod
.
IsStaticPod
(
pod
)
{
if
kubepod
.
IsStaticPod
(
pod
)
{
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
if
mirrorPod
!=
nil
&&
!
kl
.
podManager
.
IsMirrorPodOf
(
mirrorPod
,
pod
)
{
if
mirrorPod
!=
nil
&&
!
kl
.
podManager
.
IsMirrorPodOf
(
mirrorPod
,
pod
)
{
// The mirror pod is semantically different from the static pod. Remove
// The mirror pod is semantically different from the static pod. Remove
// it. The mirror pod will get recreated later.
// it. The mirror pod will get recreated later.
glog
.
Errorf
(
"Deleting mirror pod %q because it is outdated"
,
podFullName
)
glog
.
Errorf
(
"Deleting mirror pod %q because it is outdated"
,
format
.
Pod
(
mirrorPod
)
)
if
err
:=
kl
.
podManager
.
DeleteMirrorPod
(
podFullName
);
err
!=
nil
{
if
err
:=
kl
.
podManager
.
DeleteMirrorPod
(
podFullName
);
err
!=
nil
{
glog
.
Errorf
(
"Failed deleting mirror pod %q: %v"
,
podFullName
,
err
)
glog
.
Errorf
(
"Failed deleting mirror pod %q: %v"
,
format
.
Pod
(
mirrorPod
)
,
err
)
}
}
}
}
if
mirrorPod
==
nil
{
if
mirrorPod
==
nil
{
glog
.
V
(
3
)
.
Infof
(
"Creating a mirror pod for static pod %q"
,
podFullName
)
glog
.
V
(
3
)
.
Infof
(
"Creating a mirror pod for static pod %q"
,
format
.
Pod
(
pod
)
)
if
err
:=
kl
.
podManager
.
CreateMirrorPod
(
pod
);
err
!=
nil
{
if
err
:=
kl
.
podManager
.
CreateMirrorPod
(
pod
);
err
!=
nil
{
glog
.
Errorf
(
"Failed creating a mirror pod
%q: %v"
,
podFullName
,
err
)
glog
.
Errorf
(
"Failed creating a mirror pod
for %q: %v"
,
format
.
Pod
(
pod
)
,
err
)
}
}
_
,
ok
:=
kl
.
podManager
.
GetMirrorPodByPod
(
pod
)
_
,
ok
:=
kl
.
podManager
.
GetMirrorPodByPod
(
pod
)
...
@@ -1642,7 +1641,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1642,7 +1641,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
}
}
if
err
:=
kl
.
makePodDataDirs
(
pod
);
err
!=
nil
{
if
err
:=
kl
.
makePodDataDirs
(
pod
);
err
!=
nil
{
glog
.
Errorf
(
"Unable to make pod data directories for pod %q
(uid %q): %v"
,
podFullName
,
uid
,
err
)
glog
.
Errorf
(
"Unable to make pod data directories for pod %q
: %v"
,
format
.
Pod
(
pod
)
,
err
)
return
err
return
err
}
}
...
@@ -1651,8 +1650,8 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1651,8 +1650,8 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
if
err
!=
nil
{
if
err
!=
nil
{
ref
,
errGetRef
:=
api
.
GetReference
(
pod
)
ref
,
errGetRef
:=
api
.
GetReference
(
pod
)
if
errGetRef
==
nil
&&
ref
!=
nil
{
if
errGetRef
==
nil
&&
ref
!=
nil
{
kl
.
recorder
.
Eventf
(
ref
,
api
.
EventTypeWarning
,
kubecontainer
.
FailedMountVolume
,
"Unable to mount volumes for pod %q: %v"
,
podFullName
,
err
)
kl
.
recorder
.
Eventf
(
ref
,
api
.
EventTypeWarning
,
kubecontainer
.
FailedMountVolume
,
"Unable to mount volumes for pod %q: %v"
,
format
.
Pod
(
pod
)
,
err
)
glog
.
Errorf
(
"Unable to mount volumes for pod %q: %v; skipping pod"
,
podFullName
,
err
)
glog
.
Errorf
(
"Unable to mount volumes for pod %q: %v; skipping pod"
,
format
.
Pod
(
pod
)
,
err
)
return
err
return
err
}
}
}
}
...
@@ -1694,11 +1693,11 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1694,11 +1693,11 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
Name
:
pod
.
Name
,
Name
:
pod
.
Name
,
Namespace
:
pod
.
Namespace
,
Namespace
:
pod
.
Namespace
,
}
}
glog
.
V
(
3
)
.
Infof
(
"Not generating pod status for new pod %q"
,
podFullName
)
glog
.
V
(
3
)
.
Infof
(
"Not generating pod status for new pod %q"
,
format
.
Pod
(
pod
)
)
}
else
{
}
else
{
podStatusPtr
,
apiPodStatusPtr
,
err
:=
kl
.
containerRuntime
.
GetPodStatusAndAPIPodStatus
(
pod
)
podStatusPtr
,
apiPodStatusPtr
,
err
:=
kl
.
containerRuntime
.
GetPodStatusAndAPIPodStatus
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Unable to get status for pod %q
(uid %q): %v"
,
podFullName
,
uid
,
err
)
glog
.
Errorf
(
"Unable to get status for pod %q
: %v"
,
format
.
Pod
(
pod
)
,
err
)
return
err
return
err
}
}
apiPodStatus
=
*
apiPodStatusPtr
apiPodStatus
=
*
apiPodStatusPtr
...
@@ -1707,7 +1706,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1707,7 +1706,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
pullSecrets
,
err
:=
kl
.
getPullSecretsForPod
(
pod
)
pullSecrets
,
err
:=
kl
.
getPullSecretsForPod
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Unable to get pull secrets for pod %q
(uid %q): %v"
,
podFullName
,
uid
,
err
)
glog
.
Errorf
(
"Unable to get pull secrets for pod %q
: %v"
,
format
.
Pod
(
pod
)
,
err
)
return
err
return
err
}
}
...
@@ -1900,8 +1899,7 @@ func (kl *Kubelet) cleanupTerminatedPods(pods []*api.Pod, runningPods []*kubecon
...
@@ -1900,8 +1899,7 @@ func (kl *Kubelet) cleanupTerminatedPods(pods []*api.Pod, runningPods []*kubecon
}
}
}
}
if
found
{
if
found
{
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
glog
.
V
(
5
)
.
Infof
(
"Keeping terminated pod %q, still running"
,
format
.
Pod
(
pod
))
glog
.
V
(
5
)
.
Infof
(
"Keeping terminated pod %q and uid %q, still running"
,
podFullName
,
pod
.
UID
)
continue
continue
}
}
terminating
=
append
(
terminating
,
pod
)
terminating
=
append
(
terminating
,
pod
)
...
@@ -3116,8 +3114,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {
...
@@ -3116,8 +3114,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {
metrics
.
PodStatusLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
PodStatusLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}()
}()
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
glog
.
V
(
3
)
.
Infof
(
"Generating status for %q"
,
format
.
Pod
(
pod
))
glog
.
V
(
3
)
.
Infof
(
"Generating status for %q"
,
podFullName
)
// TODO: Consider include the container information.
// TODO: Consider include the container information.
if
kl
.
pastActiveDeadline
(
pod
)
{
if
kl
.
pastActiveDeadline
(
pod
)
{
...
@@ -3134,7 +3131,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {
...
@@ -3134,7 +3131,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {
if
err
!=
nil
{
if
err
!=
nil
{
// Error handling
// Error handling
glog
.
Infof
(
"Query container info for pod %q failed with error (%v)"
,
podFullName
,
err
)
glog
.
Infof
(
"Query container info for pod %q failed with error (%v)"
,
format
.
Pod
(
pod
)
,
err
)
if
strings
.
Contains
(
err
.
Error
(),
"resource temporarily unavailable"
)
{
if
strings
.
Contains
(
err
.
Error
(),
"resource temporarily unavailable"
)
{
// Leave upstream layer to decide what to do
// Leave upstream layer to decide what to do
return
api
.
PodStatus
{},
err
return
api
.
PodStatus
{},
err
...
...
pkg/kubelet/rkt/rkt.go
View file @
c6462555
...
@@ -979,8 +979,6 @@ func (r *Runtime) IsImagePresent(image kubecontainer.ImageSpec) (bool, error) {
...
@@ -979,8 +979,6 @@ func (r *Runtime) IsImagePresent(image kubecontainer.ImageSpec) (bool, error) {
// SyncPod syncs the running pod to match the specified desired pod.
// SyncPod syncs the running pod to match the specified desired pod.
func
(
r
*
Runtime
)
SyncPod
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
podStatus
api
.
PodStatus
,
_
*
kubecontainer
.
PodStatus
,
pullSecrets
[]
api
.
Secret
,
backOff
*
util
.
Backoff
)
error
{
func
(
r
*
Runtime
)
SyncPod
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
podStatus
api
.
PodStatus
,
_
*
kubecontainer
.
PodStatus
,
pullSecrets
[]
api
.
Secret
,
backOff
*
util
.
Backoff
)
error
{
podFullName
:=
format
.
Pod
(
pod
)
// Add references to all containers.
// Add references to all containers.
unidentifiedContainers
:=
make
(
map
[
kubecontainer
.
ContainerID
]
*
kubecontainer
.
Container
)
unidentifiedContainers
:=
make
(
map
[
kubecontainer
.
ContainerID
]
*
kubecontainer
.
Container
)
for
_
,
c
:=
range
runningPod
.
Containers
{
for
_
,
c
:=
range
runningPod
.
Containers
{
...
@@ -1008,14 +1006,14 @@ func (r *Runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
...
@@ -1008,14 +1006,14 @@ func (r *Runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
// TODO(yifan): Take care of host network change.
// TODO(yifan): Take care of host network change.
containerChanged
:=
c
.
Hash
!=
0
&&
c
.
Hash
!=
expectedHash
containerChanged
:=
c
.
Hash
!=
0
&&
c
.
Hash
!=
expectedHash
if
containerChanged
{
if
containerChanged
{
glog
.
Infof
(
"Pod %q container %q hash changed (%d vs %d), it will be killed and re-created."
,
podFullName
,
container
.
Name
,
c
.
Hash
,
expectedHash
)
glog
.
Infof
(
"Pod %q container %q hash changed (%d vs %d), it will be killed and re-created."
,
format
.
Pod
(
pod
)
,
container
.
Name
,
c
.
Hash
,
expectedHash
)
restartPod
=
true
restartPod
=
true
break
break
}
}
liveness
,
found
:=
r
.
livenessManager
.
Get
(
c
.
ID
)
liveness
,
found
:=
r
.
livenessManager
.
Get
(
c
.
ID
)
if
found
&&
liveness
!=
proberesults
.
Success
&&
pod
.
Spec
.
RestartPolicy
!=
api
.
RestartPolicyNever
{
if
found
&&
liveness
!=
proberesults
.
Success
&&
pod
.
Spec
.
RestartPolicy
!=
api
.
RestartPolicyNever
{
glog
.
Infof
(
"Pod %q container %q is unhealthy, it will be killed and re-created."
,
podFullName
,
container
.
Name
)
glog
.
Infof
(
"Pod %q container %q is unhealthy, it will be killed and re-created."
,
format
.
Pod
(
pod
)
,
container
.
Name
)
restartPod
=
true
restartPod
=
true
break
break
}
}
...
...
pkg/kubelet/runonce.go
View file @
c6462555
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/container"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
kubetypes
"k8s.io/kubernetes/pkg/kubelet/types"
kubetypes
"k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/kubelet/util/format"
)
)
const
(
const
(
...
@@ -109,10 +110,9 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
...
@@ -109,10 +110,9 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
}
}
glog
.
Infof
(
"pod %q containers not running: syncing"
,
pod
.
Name
)
glog
.
Infof
(
"pod %q containers not running: syncing"
,
pod
.
Name
)
podFullName
:=
kubecontainer
.
GetPodFullName
(
pod
)
glog
.
Infof
(
"Creating a mirror pod for static pod %q"
,
format
.
Pod
(
pod
))
glog
.
Infof
(
"Creating a mirror pod for static pod %q"
,
podFullName
)
if
err
:=
kl
.
podManager
.
CreateMirrorPod
(
pod
);
err
!=
nil
{
if
err
:=
kl
.
podManager
.
CreateMirrorPod
(
pod
);
err
!=
nil
{
glog
.
Errorf
(
"Failed creating a mirror pod %q: %v"
,
podFullName
,
err
)
glog
.
Errorf
(
"Failed creating a mirror pod %q: %v"
,
format
.
Pod
(
pod
)
,
err
)
}
}
mirrorPod
,
_
:=
kl
.
podManager
.
GetMirrorPodByPod
(
pod
)
mirrorPod
,
_
:=
kl
.
podManager
.
GetMirrorPodByPod
(
pod
)
...
...
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