Kubelet: refactor pod manager
This change cleans up the pod manager extensively so that * Mirror pods are actually stored in the pod manager. * Both (non-mirror) pods and mirror pods are indexed by UID and full name for easy lookup and mapping. This is required for the next change to send full pod along with the pod status update. This change also renames mirrorManager as mirrorClient since it is merely a client to contact the API server and create/delete mirror pods.
This commit is contained in:
@@ -44,7 +44,7 @@ type fakeKubelet struct {
|
||||
containerInfoFunc func(podFullName string, uid types.UID, containerName string, req *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
|
||||
rootInfoFunc func(query *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
|
||||
machineInfoFunc func() (*cadvisorApi.MachineInfo, error)
|
||||
podsFunc func() ([]api.Pod, mirrorPods)
|
||||
podsFunc func() []api.Pod
|
||||
logFunc func(w http.ResponseWriter, req *http.Request)
|
||||
runFunc func(podFullName string, uid types.UID, containerName string, cmd []string) ([]byte, error)
|
||||
dockerVersionFunc func() ([]uint, error)
|
||||
@@ -79,7 +79,7 @@ func (fk *fakeKubelet) GetCachedMachineInfo() (*cadvisorApi.MachineInfo, error)
|
||||
return fk.machineInfoFunc()
|
||||
}
|
||||
|
||||
func (fk *fakeKubelet) GetPods() ([]api.Pod, mirrorPods) {
|
||||
func (fk *fakeKubelet) GetPods() []api.Pod {
|
||||
return fk.podsFunc()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user