Skip to content

Commit

Permalink
pkg/kubelet: Do not create mirror for non-static runonce pod
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Parker committed Mar 30, 2016
1 parent c6a25b6 commit a873118
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/kubelet/runonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
kubepod "k8s.io/kubernetes/pkg/kubelet/pod"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/util/wait"
Expand Down Expand Up @@ -144,11 +145,14 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
}
glog.Infof("pod %q containers not running: syncing", format.Pod(pod))

glog.Infof("Creating a mirror pod for static pod %q", format.Pod(pod))
if err := kl.podManager.CreateMirrorPod(pod); err != nil {
glog.Errorf("Failed creating a mirror pod %q: %v", format.Pod(pod), err)
var mirrorPod *api.Pod
if kubepod.IsStaticPod(pod) {
glog.Infof("Creating a mirror pod for static pod %q", format.Pod(pod))
if err := kl.podManager.CreateMirrorPod(pod); err != nil {
glog.Errorf("Failed creating a mirror pod %q: %v", format.Pod(pod), err)
}
mirrorPod, _ = kl.podManager.GetMirrorPodByPod(pod)
}
mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod)

if err = kl.syncPod(pod, mirrorPod, status, kubetypes.SyncPodUpdate); err != nil {
return fmt.Errorf("error syncing pod %q: %v", format.Pod(pod), err)
Expand Down

1 comment on commit a873118

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 20185 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 265 Build time: 00:04:58

Please sign in to comment.