diff --git a/command/v7/shared/app_summary_displayer.go b/command/v7/shared/app_summary_displayer.go index bd7c948915..71009d66c2 100644 --- a/command/v7/shared/app_summary_displayer.go +++ b/command/v7/shared/app_summary_displayer.go @@ -181,14 +181,17 @@ func (display AppSummaryDisplayer) getDeploymentStatusText(summary v7action.Deta summary.Deployment.StatusReason, lastStatusChangeTime) } else { - return fmt.Sprintf("%s deployment currently %s", + var sb strings.Builder + sb.WriteString(fmt.Sprintf("%s deployment currently %s.", cases.Title(language.English, cases.NoLower).String(string(summary.Deployment.Strategy)), summary.Deployment.StatusReason)) if summary.Deployment.Strategy == constant.DeploymentStrategyCanary && summary.Deployment.StatusReason == constant.DeploymentStatusReasonPaused { - display.UI.DisplayNewline() - display.UI.DisplayText("Please run `cf continue-deployment myapp` to promote the canary deployment, or `cf cancel-deployment myapp` to rollback to the previous version.") + sb.WriteString(fmt.Sprintf( + "\nPlease run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", + summary.Application.Name, summary.Application.Name)) } + return sb.String() } } diff --git a/command/v7/shared/app_summary_displayer_test.go b/command/v7/shared/app_summary_displayer_test.go index 60dba68471..1e8758338f 100644 --- a/command/v7/shared/app_summary_displayer_test.go +++ b/command/v7/shared/app_summary_displayer_test.go @@ -689,7 +689,7 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING\n`)) + Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING`)) Expect(testUI.Out).NotTo(Say(`\(since`)) }) }) @@ -776,6 +776,11 @@ var _ = Describe("app summary displayer", func() { When("the deployment is paused", func() { BeforeEach(func() { summary = v7action.DetailedApplicationSummary{ + ApplicationSummary: v7action.ApplicationSummary{ + Application: resources.Application{ + Name: "some-app", + }, + }, Deployment: resources.Deployment{ Strategy: constant.DeploymentStrategyCanary, StatusValue: constant.DeploymentStatusValueActive, @@ -786,7 +791,7 @@ var _ = Describe("app summary displayer", func() { It("displays the message", func() { Expect(testUI.Out).To(Say("Canary deployment currently PAUSED.")) - Expect(testUI.Out).To(Say("Please run `cf continue-deployment myapp` to promote the canary deployment, or `cf cancel-deployment myapp` to rollback to the previous version.")) + Expect(testUI.Out).To(Say("Please run `cf continue-deployment some-app` to promote the canary deployment, or `cf cancel-deployment some-app` to rollback to the previous version.")) }) })