Skip to content

Commit

Permalink
Rebase changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gururajsh committed Jul 31, 2024
1 parent 2b090dd commit ff1ef9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 6 additions & 3 deletions command/v7/shared/app_summary_displayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
9 changes: 7 additions & 2 deletions command/v7/shared/app_summary_displayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`))
})
})
Expand Down Expand Up @@ -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,
Expand All @@ -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."))
})
})

Expand Down

0 comments on commit ff1ef9d

Please sign in to comment.