mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Merge branch 'integration/new-container-runtime' of github.com:Start9Labs/start-os into rebase/feat/domains
This commit is contained in:
@@ -23,10 +23,7 @@ export function renderPkgStatus(
|
||||
if (pkg['state-info'].state === PackageState.Installed) {
|
||||
primary = getPrimaryStatus(pkg.status)
|
||||
dependency = getDependencyStatus(depErrors)
|
||||
health = getHealthStatus(
|
||||
pkg.status,
|
||||
!isEmptyObject(pkg['state-info'].manifest['health-checks']),
|
||||
)
|
||||
health = getHealthStatus(pkg.status)
|
||||
} else {
|
||||
primary = pkg['state-info'].state as string as PrimaryStatus
|
||||
}
|
||||
@@ -49,12 +46,16 @@ function getDependencyStatus(depErrors: PkgDependencyErrors): DependencyStatus {
|
||||
}
|
||||
|
||||
function getHealthStatus(status: Status): HealthStatus | null {
|
||||
if (status.main.status !== PackageMainStatus.Running) {
|
||||
if (status.main.status !== PackageMainStatus.Running || !status.main.health) {
|
||||
return null
|
||||
}
|
||||
|
||||
const values = Object.values(status.main.health)
|
||||
|
||||
if (values.some(h => !h.result)) {
|
||||
return HealthStatus.Waiting
|
||||
}
|
||||
|
||||
if (values.some(h => h.result === 'failure')) {
|
||||
return HealthStatus.Failure
|
||||
}
|
||||
@@ -63,7 +64,7 @@ function getHealthStatus(status: Status): HealthStatus | null {
|
||||
return HealthStatus.Loading
|
||||
}
|
||||
|
||||
if (values.some(h => !h.result || h.result === 'starting')) {
|
||||
if (values.some(h => h.result === 'starting')) {
|
||||
return HealthStatus.Starting
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user