consul: kill remaining use of HealthUnknown

pull/401/head
Ryan Uber 10 years ago
parent f311ada60e
commit 2f93e13da8

@ -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,

@ -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,

@ -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
}

@ -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)

@ -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

@ -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"

Loading…
Cancel
Save