From 9fe910dac517bd13418651b38e99f17a827f539b Mon Sep 17 00:00:00 2001 From: Michail Kargakis Date: Wed, 9 Nov 2016 10:45:02 +0100 Subject: [PATCH] controller: fix panic in deployments --- pkg/controller/deployment/progress.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controller/deployment/progress.go b/pkg/controller/deployment/progress.go index 0d915e62e6b..f2dd458e633 100644 --- a/pkg/controller/deployment/progress.go +++ b/pkg/controller/deployment/progress.go @@ -87,8 +87,9 @@ func (dc *DeploymentController) syncRolloutStatus(allRSs []*extensions.ReplicaSe currentCond := util.GetDeploymentCondition(d.Status, extensions.DeploymentProgressing) 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 - // hasn't completed yet. - if d.Spec.ProgressDeadlineSeconds != nil && !isResyncEvent { + // hasn't completed yet. We also need to ensure the new replica set exists, otherwise + // we cannot estimate any progress. + if d.Spec.ProgressDeadlineSeconds != nil && !isResyncEvent && newRS != nil { switch { case util.DeploymentComplete(d, &newStatus): // Update the deployment conditions with a message for the new replica set that