kubelet: move common types to kubelet/types

This would faciliate tasks such as moving code in pkg/kubelet to sub packages.
This commit is contained in:
Yu-Ju Hong
2015-10-06 17:44:08 -07:00
parent 27ff98c8f3
commit 098ab05997
28 changed files with 246 additions and 235 deletions

View File

@@ -24,6 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/container"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
kubeletTypes "k8s.io/kubernetes/pkg/kubelet/types"
)
const (
@@ -39,7 +40,7 @@ type RunPodResult struct {
}
// RunOnce polls from one configuration update and run the associated pods.
func (kl *Kubelet) RunOnce(updates <-chan PodUpdate) ([]RunPodResult, error) {
func (kl *Kubelet) RunOnce(updates <-chan kubeletTypes.PodUpdate) ([]RunPodResult, error) {
select {
case u := <-updates:
glog.Infof("processing manifest with %d pods", len(u.Pods))
@@ -109,7 +110,7 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
glog.Infof("pod %q containers not running: syncing", pod.Name)
// We don't create mirror pods in this mode; pass a dummy boolean value
// to sycnPod.
if err = kl.syncPod(pod, nil, p, SyncPodUpdate); err != nil {
if err = kl.syncPod(pod, nil, p, kubeletTypes.SyncPodUpdate); err != nil {
return fmt.Errorf("error syncing pod: %v", err)
}
if retry >= RunOnceMaxRetries {