mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Removes RunPod in the Runtime interface
SyncPod subsumes RunPod, so the latter is no longer needed. After this change, DockerManager implements the Runtime interface.
This commit is contained in:
parent
ee473edd45
commit
4fe3366b04
@ -128,11 +128,11 @@ func (f *FakeRuntime) GetPods(all bool) ([]*Pod, error) {
|
|||||||
return f.Podlist, f.Err
|
return f.Podlist, f.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeRuntime) RunPod(pod *api.Pod, volumeMap map[string]volume.VolumePlugin) error {
|
func (f *FakeRuntime) SyncPod(pod *api.Pod, _ Pod, _ api.PodStatus) error {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
|
|
||||||
f.CalledFunctions = append(f.CalledFunctions, "RunPod")
|
f.CalledFunctions = append(f.CalledFunctions, "SyncPod")
|
||||||
f.StartedPods = append(f.StartedPods, string(pod.UID))
|
f.StartedPods = append(f.StartedPods, string(pod.UID))
|
||||||
for _, c := range pod.Spec.Containers {
|
for _, c := range pod.Spec.Containers {
|
||||||
f.StartedContainers = append(f.StartedContainers, c.Name)
|
f.StartedContainers = append(f.StartedContainers, c.Name)
|
||||||
|
@ -23,7 +23,6 @@ import (
|
|||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/volume"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Version interface {
|
type Version interface {
|
||||||
@ -44,8 +43,6 @@ type Runtime interface {
|
|||||||
// specifies whether the runtime returns all containers including those already
|
// specifies whether the runtime returns all containers including those already
|
||||||
// exited and dead containers (used for garbage collection).
|
// exited and dead containers (used for garbage collection).
|
||||||
GetPods(all bool) ([]*Pod, error)
|
GetPods(all bool) ([]*Pod, error)
|
||||||
// RunPod starts all the containers of a pod within a namespace.
|
|
||||||
RunPod(*api.Pod, map[string]volume.Volume) error
|
|
||||||
// Syncs the running pod into the desired pod.
|
// Syncs the running pod into the desired pod.
|
||||||
SyncPod(pod *api.Pod, runningPod Pod, podStatus api.PodStatus) error
|
SyncPod(pod *api.Pod, runningPod Pod, podStatus api.PodStatus) error
|
||||||
// KillPod kills all the containers of a pod.
|
// KillPod kills all the containers of a pod.
|
||||||
|
@ -54,7 +54,8 @@ const (
|
|||||||
maxReasonCacheEntries = 200
|
maxReasonCacheEntries = 200
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(yjhong): DockerManager should implement the Runtime interface.
|
// DockerManager implements the Runtime interface.
|
||||||
|
var _ kubecontainer.Runtime = &DockerManager{}
|
||||||
|
|
||||||
type DockerManager struct {
|
type DockerManager struct {
|
||||||
client DockerInterface
|
client DockerInterface
|
||||||
|
Loading…
Reference in New Issue
Block a user