sigh, further status changes (#1371)

This commit is contained in:
Asim Aslam
2020-03-18 22:47:03 +00:00
committed by GitHub
parent 5ad7c36bd4
commit 40ff6ddfcf
2 changed files with 39 additions and 6 deletions

View File

@@ -152,6 +152,22 @@ func (k *kubernetes) getService(labels map[string]string) ([]*service, error) {
status = item.Status.Phase
}
// now try get a deeper status
state := item.Status.Containers[0].State
// set start time
if state.Running != nil {
svc.Metadata["started"] = state.Running.Started
}
// set status from waiting
if v := state.Waiting; v != nil {
if len(v.Reason) > 0 {
status = v.Reason
}
}
// TODO: set from terminated
svc.Metadata["status"] = status
}