diff --git a/core/status/caas.go b/core/status/caas.go index 3fba279193e..d4f8dcc8fda 100644 --- a/core/status/caas.go +++ b/core/status/caas.go @@ -76,9 +76,10 @@ func ApplicationDisplayStatus(applicationStatus, operatorStatus StatusInfo, expe return operatorStatus } - // Check if the application status has been set to a higher severity status - // than the operator status (e.g. set to maintenance by the charm) - if statusSeverities[appStatus] > statusSeverities[opStatus] { + // Check if the application status has been set to an equivalent or higher + // severity status than the operator status (e.g. set to waiting by the + // charm) + if statusSeverities[appStatus] >= statusSeverities[opStatus] { return applicationStatus } diff --git a/core/status/caas_test.go b/core/status/caas_test.go index 0ddd39c033a..4dbd314cc27 100644 --- a/core/status/caas_test.go +++ b/core/status/caas_test.go @@ -280,6 +280,18 @@ func (s *UnitCloudStatusSuite) TestApplicatoinOpeartorStatusChoice(c *gc.C) { Status: status.Waiting, Message: "unit", }, + expectWorkload: true, + messageCheck: "unit", + }, + { + operatorStatus: status.StatusInfo{ + Status: status.Waiting, + Message: "operator", + }, + appStatus: status.StatusInfo{ + Status: status.Active, + Message: "unit", + }, expectWorkload: false, messageCheck: "installing agent", },