mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
controller: fix panic in deployments
This commit is contained in:
parent
c41c603baa
commit
9fe910dac5
@ -87,8 +87,9 @@ func (dc *DeploymentController) syncRolloutStatus(allRSs []*extensions.ReplicaSe
|
|||||||
currentCond := util.GetDeploymentCondition(d.Status, extensions.DeploymentProgressing)
|
currentCond := util.GetDeploymentCondition(d.Status, extensions.DeploymentProgressing)
|
||||||
isResyncEvent := newStatus.Replicas == newStatus.UpdatedReplicas && currentCond != nil && currentCond.Reason == util.NewRSAvailableReason
|
isResyncEvent := newStatus.Replicas == newStatus.UpdatedReplicas && currentCond != nil && currentCond.Reason == util.NewRSAvailableReason
|
||||||
// Check for progress only if there is a progress deadline set and the latest rollout
|
// Check for progress only if there is a progress deadline set and the latest rollout
|
||||||
// hasn't completed yet.
|
// hasn't completed yet. We also need to ensure the new replica set exists, otherwise
|
||||||
if d.Spec.ProgressDeadlineSeconds != nil && !isResyncEvent {
|
// we cannot estimate any progress.
|
||||||
|
if d.Spec.ProgressDeadlineSeconds != nil && !isResyncEvent && newRS != nil {
|
||||||
switch {
|
switch {
|
||||||
case util.DeploymentComplete(d, &newStatus):
|
case util.DeploymentComplete(d, &newStatus):
|
||||||
// Update the deployment conditions with a message for the new replica set that
|
// Update the deployment conditions with a message for the new replica set that
|
||||||
|
Loading…
Reference in New Issue
Block a user