mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #18331 from janetkuo/fix-deployment-getnewrc
Fix bug when getting new RC of a deployment
This commit is contained in:
commit
9d1f07da4e
@ -77,10 +77,10 @@ func GetNewRC(deployment extensions.Deployment, c client.Interface) (*api.Replic
|
|||||||
}
|
}
|
||||||
newRCTemplate := GetNewRCTemplate(deployment)
|
newRCTemplate := GetNewRCTemplate(deployment)
|
||||||
|
|
||||||
for _, rc := range rcList.Items {
|
for i := range rcList.Items {
|
||||||
if api.Semantic.DeepEqual(rc.Spec.Template, &newRCTemplate) {
|
if api.Semantic.DeepEqual(rcList.Items[i].Spec.Template, &newRCTemplate) {
|
||||||
// This is the new RC.
|
// This is the new RC.
|
||||||
return &rc, nil
|
return &rcList.Items[i], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// new RC does not exist.
|
// new RC does not exist.
|
||||||
|
Loading…
Reference in New Issue
Block a user