Esempio n. 1
0
File: rest.go Progetto: 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
}
Esempio n. 2
0
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
}