Change:
should have the JSON attribute name "items", not "minions"
Doh! Fix now and break clients?
Define Items and Minions and use Convertors to resolve it?
Sure. I'll make a fix.

Discussion:
} return nil }, <ins> // MinionList.Items had a wrong name in v1beta1 func(in *MinionList, out *v1beta1.MinionList) error { Convert(&in.JSONBase, &out.JSONBase) Convert(&in.Items, &out.Items) out.Minions = out.Items return nil }, func(in *v1beta1.MinionList, out *MinionList) error { Convert(&in.JSONBase, &out.JSONBase) if len(in.Items) == 0 { Convert(&in.Minions, &out.Items) } else { Convert(&in.Items, &out.Items) } return nil }, </ins> ) }

} } } <ins> func TestMinionListConversionToNew(t *testing.T) { oldMinion := func(id string) v1beta1.Minion { return v1beta1.Minion{JSONBase: v1beta1.JSONBase{ID: id}} } newMinion := func(id string) Minion { return Minion{JSONBase: JSONBase{ID: id}} } oldMinions := []v1beta1.Minion{ oldMinion("foo"), oldMinion("bar"), } newMinions := []Minion{ newMinion("foo"), newMinion("bar"), } table := []struct { oldML *v1beta1.MinionList newML *MinionList }{ { oldML: &v1beta1.MinionList{Items: oldMinions}, newML: &MinionList{Items: newMinions}, }, { oldML: &v1beta1.MinionList{Minions: oldMinions}, newML: &MinionList{Items: newMinions}, }, { oldML: &v1beta1.MinionList{ Items:   oldMinions, Minions: []v1beta1.Minion{oldMinion("baz")}, }, newML: &MinionList{Items: newMinions}, }, } for _, item := range table { got := &MinionList{} err := Convert(item.oldML, got) if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := item.newML, got; !reflect.DeepEqual(e, a) { t.Errorf("Expected: %#v, got %#v", e, a) } } } func TestMinionListConversionToOld(t *testing.T) { oldMinion := func(id string) v1beta1.Minion { return v1beta1.Minion{JSONBase: v1beta1.JSONBase{ID: id}} } newMinion := func(id string) Minion { return Minion{JSONBase: JSONBase{ID: id}} } oldMinions := []v1beta1.Minion{ oldMinion("foo"), oldMinion("bar"), } newMinions := []Minion{ newMinion("foo"), newMinion("bar"), } newML := &MinionList{Items: newMinions} oldML := &v1beta1.MinionList{ Items:   oldMinions, Minions: oldMinions, } got := &v1beta1.MinionList{} err := Convert(newML, got) if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := oldML, got; !reflect.DeepEqual(e, a) { t.Errorf("Expected: %#v, got %#v", e, a) } } </ins>

// MinionList is a list of minions. type MinionList struct { JSONBase `json:",inline" yaml:",inline"` <del> Items    []Minion `json:"minions,omitempty" yaml:"minions,omitempty"` </del> <ins> Items    []Minion `json:"items,omitempty" yaml:"items,omitempty"` </ins> } // Binding is written by a scheduler to cause a pod to be bound to a host.

// MinionList is a list of minions. type MinionList struct { JSONBase `json:",inline" yaml:",inline"` <del> Items    []Minion `json:"minions,omitempty" yaml:"minions,omitempty"` </del> <ins> // DEPRECATED: the below Minions is due to a naming mistake and // will be replaced with Items in the future. Minions []Minion `json:"minions,omitempty" yaml:"minions,omitempty"` Items   []Minion `json:"items,omitempty" yaml:"items,omitempty"` </ins> } // Binding is written by a scheduler to cause a pod to be bound to a host.