mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #154 from brendandburns/fix-etcd
Fix a bug in pod listing introduced in a recent refactor.
This commit is contained in:
commit
6647f040f1
@ -78,6 +78,7 @@ func (registry *EtcdRegistry) ListPods(query labels.Query) ([]api.Pod, error) {
|
||||
}
|
||||
for _, pod := range machinePods {
|
||||
if query.Matches(labels.Set(pod.Labels)) {
|
||||
pod.CurrentState.Host = machine
|
||||
pods = append(pods, pod)
|
||||
}
|
||||
}
|
||||
|
@ -354,6 +354,10 @@ func TestEtcdListPods(t *testing.T) {
|
||||
if len(pods) != 2 || pods[0].ID != "foo" || pods[1].ID != "bar" {
|
||||
t.Errorf("Unexpected pod list: %#v", pods)
|
||||
}
|
||||
if pods[0].CurrentState.Host != "machine" ||
|
||||
pods[1].CurrentState.Host != "machine" {
|
||||
t.Errorf("Failed to populate host name.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEtcdListControllersNotFound(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user