consul: kill remaining use of HealthUnknown

This commit is contained in:
Ryan Uber 2014-10-15 10:14:46 -07:00
parent 967cc6d701
commit ec63686416
6 changed files with 9 additions and 10 deletions

View File

@ -437,7 +437,7 @@ func (a *Agent) AddService(service *structs.NodeService, chkType *CheckType) err
Node: a.config.NodeName,
CheckID: fmt.Sprintf("service:%s", service.ID),
Name: fmt.Sprintf("Service '%s' check", service.Service),
Status: structs.HealthUnknown,
Status: structs.HealthCritical,
Notes: "",
ServiceID: service.ID,
ServiceName: service.Service,

View File

@ -186,7 +186,7 @@ func TestAgent_AddCheck(t *testing.T) {
Node: "foo",
CheckID: "mem",
Name: "memory util",
Status: structs.HealthUnknown,
Status: structs.HealthCritical,
}
chk := &CheckType{
Script: "exit 0",
@ -217,7 +217,7 @@ func TestAgent_AddCheck_MinInterval(t *testing.T) {
Node: "foo",
CheckID: "mem",
Name: "memory util",
Status: structs.HealthUnknown,
Status: structs.HealthCritical,
}
chk := &CheckType{
Script: "exit 0",
@ -255,7 +255,7 @@ func TestAgent_RemoveCheck(t *testing.T) {
Node: "foo",
CheckID: "mem",
Name: "memory util",
Status: structs.HealthUnknown,
Status: structs.HealthCritical,
}
chk := &CheckType{
Script: "exit 0",
@ -291,7 +291,7 @@ func TestAgent_UpdateCheck(t *testing.T) {
Node: "foo",
CheckID: "mem",
Name: "memory util",
Status: structs.HealthUnknown,
Status: structs.HealthCritical,
}
chk := &CheckType{
TTL: 15 * time.Second,

View File

@ -109,7 +109,7 @@ func (c *CheckMonitor) check() {
cmd, err := ExecScript(c.Script)
if err != nil {
c.Logger.Printf("[ERR] agent: failed to setup invoke '%s': %s", c.Script, err)
c.Notify.UpdateCheck(c.CheckID, structs.HealthUnknown, err.Error())
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, err.Error())
return
}
@ -121,7 +121,7 @@ func (c *CheckMonitor) check() {
// Start the check
if err := cmd.Start(); err != nil {
c.Logger.Printf("[ERR] agent: failed to invoke '%s': %s", c.Script, err)
c.Notify.UpdateCheck(c.CheckID, structs.HealthUnknown, err.Error())
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, err.Error())
return
}

View File

@ -172,7 +172,7 @@ func TestAgentAntiEntropy_Checks(t *testing.T) {
chk2_mod := new(structs.HealthCheck)
*chk2_mod = *chk2
chk2_mod.Status = structs.HealthUnknown
chk2_mod.Status = structs.HealthCritical
args.Check = chk2_mod
if err := agent.RPC("Catalog.Register", args, &out); err != nil {
t.Fatalf("err: %v", err)

View File

@ -762,7 +762,7 @@ func (s *StateStore) EnsureCheck(index uint64, check *structs.HealthCheck) error
func (s *StateStore) ensureCheckTxn(index uint64, check *structs.HealthCheck, tx *MDBTxn) error {
// Ensure we have a status
if check.Status == "" {
check.Status = structs.HealthUnknown
check.Status = structs.HealthCritical
}
// Ensure the node exists

View File

@ -29,7 +29,6 @@ const (
// HealthAny is special, and is used as a wild card,
// not as a specific state.
HealthAny = "any"
HealthUnknown = "unknown"
HealthPassing = "passing"
HealthWarning = "warning"
HealthCritical = "critical"