Commit a1501fde authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #28550 from janetkuo/e2e-deployment-rollover-log

Automatic merge from submit-queue Log available pods of deployments when scaling down old RS Ref #26834 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
parents e232ecd2 08305f12
...@@ -93,6 +93,7 @@ func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.Rep ...@@ -93,6 +93,7 @@ func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.Rep
if err != nil { if err != nil {
return false, fmt.Errorf("could not find available pods: %v", err) return false, fmt.Errorf("could not find available pods: %v", err)
} }
glog.V(4).Infof("New RS %s/%s has %d available pods.", newRS.Namespace, newRS.Name, newRSAvailablePodCount)
maxUnavailable := maxUnavailable(*deployment) maxUnavailable := maxUnavailable(*deployment)
// Check if we can scale down. We can scale down in the following 2 cases: // Check if we can scale down. We can scale down in the following 2 cases:
...@@ -172,6 +173,7 @@ func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.Re ...@@ -172,6 +173,7 @@ func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.Re
if err != nil { if err != nil {
return nil, totalScaledDown, fmt.Errorf("could not find available pods: %v", err) return nil, totalScaledDown, fmt.Errorf("could not find available pods: %v", err)
} }
glog.V(4).Infof("Found %d available pods in old RS %s/%s", availablePodCount, targetRS.Namespace, targetRS.Name)
if targetRS.Spec.Replicas == availablePodCount { if targetRS.Spec.Replicas == availablePodCount {
// no unhealthy replicas found, no scaling required. // no unhealthy replicas found, no scaling required.
continue continue
......
...@@ -356,6 +356,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 { ...@@ -356,6 +356,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 {
for _, pod := range pods { for _, pod := range pods {
// TODO: Make the time.Now() as argument to allow unit test this. // TODO: Make the time.Now() as argument to allow unit test this.
if IsPodAvailable(&pod, minReadySeconds, time.Now()) { if IsPodAvailable(&pod, minReadySeconds, time.Now()) {
glog.V(4).Infof("Pod %s/%s is available.", pod.Namespace, pod.Name)
availablePodCount++ availablePodCount++
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment