Return one of the Site* statuses to describe the overall status of the project
(statuses map[string]string)
| 1238 | |
| 1239 | // Return one of the Site* statuses to describe the overall status of the project |
| 1240 | func (app *DdevApp) determineStatus(statuses map[string]string) string { |
| 1241 | hasCommonStatus, commonStatus := app.getCommonStatus(statuses) |
| 1242 | |
| 1243 | if hasCommonStatus { |
| 1244 | return commonStatus |
| 1245 | } |
| 1246 | |
| 1247 | for status := range statuses { |
| 1248 | if status == SiteStarting { |
| 1249 | return SiteStarting |
| 1250 | } |
| 1251 | } |
| 1252 | |
| 1253 | return SiteUnhealthy |
| 1254 | } |
| 1255 | |
| 1256 | // Check whether a common status applies to all services |
| 1257 | func (app *DdevApp) getCommonStatus(statuses map[string]string) (bool, string) { |
no test coverage detected