mirror of https://github.com/k3s-io/k3s
include rollout object name in cli message
parent
b9e46f5422
commit
1b1c2d1264
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue