Add a kubelet /runningpods endpoint
/runningpods returns a list of pods currently running on the kubelet. The list is composed by examining the container runtime, and may be different from the desired pods to run known by kubelet. This is useful for tests to verify that pods are indeed deleted on nodes.
This commit is contained in:
@@ -47,6 +47,7 @@ type fakeKubelet struct {
|
||||
rawInfoFunc func(query *cadvisorApi.ContainerInfoRequest) (map[string]*cadvisorApi.ContainerInfo, error)
|
||||
machineInfoFunc func() (*cadvisorApi.MachineInfo, error)
|
||||
podsFunc func() []*api.Pod
|
||||
runningPodsFunc func() ([]*api.Pod, error)
|
||||
logFunc func(w http.ResponseWriter, req *http.Request)
|
||||
runFunc func(podFullName string, uid types.UID, containerName string, cmd []string) ([]byte, error)
|
||||
containerVersionFunc func() (kubecontainer.Version, error)
|
||||
@@ -91,6 +92,10 @@ func (fk *fakeKubelet) GetPods() []*api.Pod {
|
||||
return fk.podsFunc()
|
||||
}
|
||||
|
||||
func (fk *fakeKubelet) GetRunningPods() ([]*api.Pod, error) {
|
||||
return fk.runningPodsFunc()
|
||||
}
|
||||
|
||||
func (fk *fakeKubelet) ServeLogs(w http.ResponseWriter, req *http.Request) {
|
||||
fk.logFunc(w, req)
|
||||
}
|
||||
|
Reference in New Issue
Block a user