Unverified Commit 99089218 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64438 from dixudx/cli_rollout_name

Automatic merge from submit-queue (batch tested with PRs 64318, 64269, 64438, 64516, 64311). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. include rollout object name in cli message **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #64331 **Special notes for your reviewer**: /cc soltysh **Release note**: ```release-note None ```
parents dd139699 1b1c2d12
......@@ -83,13 +83,13 @@ func (s *DeploymentStatusViewer) Status(namespace, name string, revision int64)
return "", false, fmt.Errorf("deployment %q exceeded its progress deadline", name)
}
if deployment.Spec.Replicas != nil && deployment.Status.UpdatedReplicas < *deployment.Spec.Replicas {
return fmt.Sprintf("Waiting for rollout to finish: %d out of %d new replicas have been updated...\n", deployment.Status.UpdatedReplicas, *deployment.Spec.Replicas), false, nil
return fmt.Sprintf("Waiting for deployment %q rollout to finish: %d out of %d new replicas have been updated...\n", name, deployment.Status.UpdatedReplicas, *deployment.Spec.Replicas), false, nil
}
if deployment.Status.Replicas > deployment.Status.UpdatedReplicas {
return fmt.Sprintf("Waiting for rollout to finish: %d old replicas are pending termination...\n", deployment.Status.Replicas-deployment.Status.UpdatedReplicas), false, nil
return fmt.Sprintf("Waiting for deployment %q rollout to finish: %d old replicas are pending termination...\n", name, deployment.Status.Replicas-deployment.Status.UpdatedReplicas), false, nil
}
if deployment.Status.AvailableReplicas < deployment.Status.UpdatedReplicas {
return fmt.Sprintf("Waiting for rollout to finish: %d of %d updated replicas are available...\n", deployment.Status.AvailableReplicas, deployment.Status.UpdatedReplicas), false, nil
return fmt.Sprintf("Waiting for deployment %q rollout to finish: %d of %d updated replicas are available...\n", name, deployment.Status.AvailableReplicas, deployment.Status.UpdatedReplicas), false, nil
}
return fmt.Sprintf("deployment %q successfully rolled out\n", name), true, nil
}
......@@ -109,10 +109,10 @@ func (s *DaemonSetStatusViewer) Status(namespace, name string, revision int64) (
}
if daemon.Generation <= daemon.Status.ObservedGeneration {
if daemon.Status.UpdatedNumberScheduled < daemon.Status.DesiredNumberScheduled {
return fmt.Sprintf("Waiting for rollout to finish: %d out of %d new pods have been updated...\n", daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), false, nil
return fmt.Sprintf("Waiting for daemon set %q rollout to finish: %d out of %d new pods have been updated...\n", name, daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), false, nil
}
if daemon.Status.NumberAvailable < daemon.Status.DesiredNumberScheduled {
return fmt.Sprintf("Waiting for rollout to finish: %d of %d updated pods are available...\n", daemon.Status.NumberAvailable, daemon.Status.DesiredNumberScheduled), false, nil
return fmt.Sprintf("Waiting for daemon set %q rollout to finish: %d of %d updated pods are available...\n", name, daemon.Status.NumberAvailable, daemon.Status.DesiredNumberScheduled), false, nil
}
return fmt.Sprintf("daemon set %q successfully rolled out\n", name), true, nil
}
......
......@@ -45,7 +45,7 @@ func TestDeploymentStatusViewerStatus(t *testing.T) {
UnavailableReplicas: 0,
},
msg: "Waiting for rollout to finish: 0 out of 1 new replicas have been updated...\n",
msg: "Waiting for deployment \"foo\" rollout to finish: 0 out of 1 new replicas have been updated...\n",
done: false,
},
{
......@@ -59,7 +59,7 @@ func TestDeploymentStatusViewerStatus(t *testing.T) {
UnavailableReplicas: 0,
},
msg: "Waiting for rollout to finish: 1 old replicas are pending termination...\n",
msg: "Waiting for deployment \"foo\" rollout to finish: 1 old replicas are pending termination...\n",
done: false,
},
{
......@@ -73,7 +73,7 @@ func TestDeploymentStatusViewerStatus(t *testing.T) {
UnavailableReplicas: 1,
},
msg: "Waiting for rollout to finish: 1 of 2 updated replicas are available...\n",
msg: "Waiting for deployment \"foo\" rollout to finish: 1 of 2 updated replicas are available...\n",
done: false,
},
{
......@@ -155,7 +155,7 @@ func TestDaemonSetStatusViewerStatus(t *testing.T) {
NumberAvailable: 0,
},
msg: "Waiting for rollout to finish: 0 out of 1 new pods have been updated...\n",
msg: "Waiting for daemon set \"foo\" rollout to finish: 0 out of 1 new pods have been updated...\n",
done: false,
},
{
......@@ -167,7 +167,7 @@ func TestDaemonSetStatusViewerStatus(t *testing.T) {
NumberAvailable: 1,
},
msg: "Waiting for rollout to finish: 1 of 2 updated pods are available...\n",
msg: "Waiting for daemon set \"foo\" rollout to finish: 1 of 2 updated pods are available...\n",
done: false,
},
{
......
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