mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Fix revision when SetDeploymentRevision
This commit is contained in:
parent
b617cabfca
commit
6c13a02026
@ -287,9 +287,7 @@ func TestReentrantRollback(t *testing.T) {
|
|||||||
d := newDeployment("foo", 1, nil, nil, nil, map[string]string{"foo": "bar"})
|
d := newDeployment("foo", 1, nil, nil, nil, map[string]string{"foo": "bar"})
|
||||||
|
|
||||||
d.Spec.RollbackTo = &extensions.RollbackConfig{Revision: 0}
|
d.Spec.RollbackTo = &extensions.RollbackConfig{Revision: 0}
|
||||||
// TODO: This is 1 for now until FindOldReplicaSets gets fixed.
|
d.Annotations = map[string]string{util.RevisionAnnotation: "2"}
|
||||||
// See https://github.com/kubernetes/kubernetes/issues/42570.
|
|
||||||
d.Annotations = map[string]string{util.RevisionAnnotation: "1"}
|
|
||||||
f.dLister = append(f.dLister, d)
|
f.dLister = append(f.dLister, d)
|
||||||
|
|
||||||
rs1 := newReplicaSet(d, "deploymentrs-old", 0)
|
rs1 := newReplicaSet(d, "deploymentrs-old", 0)
|
||||||
|
@ -259,7 +259,8 @@ func (dc *DeploymentController) getNewReplicaSet(deployment *extensions.Deployme
|
|||||||
return dc.client.Extensions().ReplicaSets(rsCopy.ObjectMeta.Namespace).Update(rsCopy)
|
return dc.client.Extensions().ReplicaSets(rsCopy.ObjectMeta.Namespace).Update(rsCopy)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateConditions := deploymentutil.SetDeploymentRevision(deployment, newRevision)
|
// Should use the revision in existingNewRS's annotation, since it set by before
|
||||||
|
updateConditions := deploymentutil.SetDeploymentRevision(deployment, rsCopy.Annotations[deploymentutil.RevisionAnnotation])
|
||||||
// If no other Progressing condition has been recorded and we need to estimate the progress
|
// If no other Progressing condition has been recorded and we need to estimate the progress
|
||||||
// of this deployment then it is likely that old users started caring about progress. In that
|
// of this deployment then it is likely that old users started caring about progress. In that
|
||||||
// case we need to take into account the first time we noticed their new replica set.
|
// case we need to take into account the first time we noticed their new replica set.
|
||||||
|
Loading…
Reference in New Issue
Block a user