diff --git a/pkg/util/deployment/deployment.go b/pkg/util/deployment/deployment.go index 6d2e38d3512..098c3cd0047 100644 --- a/pkg/util/deployment/deployment.go +++ b/pkg/util/deployment/deployment.go @@ -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.