mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
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:
@@ -82,7 +82,7 @@ type HostInterface interface {
|
||||
GetRootInfo(req *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
|
||||
GetDockerVersion() ([]uint, error)
|
||||
GetCachedMachineInfo() (*cadvisorApi.MachineInfo, error)
|
||||
GetPods() ([]api.Pod, mirrorPods)
|
||||
GetPods() []api.Pod
|
||||
GetPodByName(namespace, name string) (*api.Pod, bool)
|
||||
GetPodStatus(name string) (api.PodStatus, error)
|
||||
RunInContainer(name string, uid types.UID, container string, cmd []string) ([]byte, error)
|
||||
@@ -260,7 +260,7 @@ func (s *Server) handleContainerLogs(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
// handlePods returns a list of pod bound to the Kubelet and their spec
|
||||
func (s *Server) handlePods(w http.ResponseWriter, req *http.Request) {
|
||||
pods, _ := s.host.GetPods()
|
||||
pods := s.host.GetPods()
|
||||
podList := &api.PodList{
|
||||
Items: pods,
|
||||
}
|
||||
|
Reference in New Issue
Block a user