Fix bug when getting new RC of a deployment

This commit is contained in:
Janet Kuo 2015-12-07 23:57:30 -08:00
parent d0d27be9b0
commit 72bd4e8caf

View File

@ -77,10 +77,10 @@ func GetNewRC(deployment extensions.Deployment, c client.Interface) (*api.Replic
}
newRCTemplate := GetNewRCTemplate(deployment)
for _, rc := range rcList.Items {
if api.Semantic.DeepEqual(rc.Spec.Template, &newRCTemplate) {
for i := range rcList.Items {
if api.Semantic.DeepEqual(rcList.Items[i].Spec.Template, &newRCTemplate) {
// This is the new RC.
return &rc, nil
return &rcList.Items[i], nil
}
}
// new RC does not exist.