예제 #1
0
파일: rest.go 프로젝트: 40a/bootkube
func (rs *REST) getComponentStatus(name string, server apiserver.Server) *api.ComponentStatus {
	status, msg, err := server.DoServerCheck(rs.prober)
	errorMsg := ""
	if err != nil {
		errorMsg = err.Error()
	}

	c := &api.ComponentCondition{
		Type:    api.ComponentHealthy,
		Status:  ToConditionStatus(status),
		Message: msg,
		Error:   errorMsg,
	}

	retVal := &api.ComponentStatus{
		Conditions: []api.ComponentCondition{*c},
	}
	retVal.Name = name

	return retVal
}
예제 #2
0
파일: rest.go 프로젝트: johnmccawley/origin
func (rs *REST) getComponentStatus(name string, server apiserver.Server) *api.ComponentStatus {
	transport := rs.rt
	status, msg, err := server.DoServerCheck(transport)
	var errorMsg string
	if err != nil {
		errorMsg = err.Error()
	} else {
		errorMsg = "nil"
	}

	c := &api.ComponentCondition{
		Type:    api.ComponentHealthy,
		Status:  ToConditionStatus(status),
		Message: msg,
		Error:   errorMsg,
	}

	retVal := &api.ComponentStatus{
		Conditions: []api.ComponentCondition{*c},
	}
	retVal.Name = name

	return retVal
}