1 回答
TA贡献1775条经验 获得超8个赞
是的,它可以简化和缩短:
func overallInstallationStatus(installStatus []apiv.Installstatus) string {
overallStatus := "running"
for _, status := range installStatus {
switch status.ReleaseStatus {
case release.StatusFailed.String():
//If at least one installation is in failed, we consider the overallstatus to be in error state
return "error"
case release.StatusDeployed.String():
//If no other status was found and there is at least one deployed chart, we consider it "running"
continue
default:
//All other statuses are considered to be "installing"
overallStatus = "installing"
}
}
return overallStatus
}
- 1 回答
- 0 关注
- 101 浏览
添加回答
举报