Skip to content

Commit

Permalink
Merge pull request kubernetes#18331 from janetkuo/fix-deployment-getn…
Browse files Browse the repository at this point in the history
…ewrc

Fix bug when getting new RC of a deployment
  • Loading branch information
nikhiljindal committed Dec 10, 2015
2 parents b9aa710 + 72bd4e8 commit 9d1f07d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/util/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9d1f07d

Please sign in to comment.