From 7c6c3b38bcc8b5630c6925c862f93564053fe776 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Sat, 30 Jul 2016 19:33:14 +0530 Subject: [PATCH] Fixes #1775; Removes 'unknown' state Signed-off-by: Abhinav Dahiya --- api/health.go | 2 -- command/agent/dns_test.go | 21 --------------------- consul/structs/structs.go | 1 - 3 files changed, 24 deletions(-) diff --git a/api/health.go b/api/health.go index 5bb403f554..74da949c8d 100644 --- a/api/health.go +++ b/api/health.go @@ -8,7 +8,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" @@ -122,7 +121,6 @@ func (h *Health) State(state string, q *QueryOptions) ([]*HealthCheck, *QueryMet case HealthWarning: case HealthCritical: case HealthPassing: - case HealthUnknown: default: return nil, nil, fmt.Errorf("Unsupported state: %v", state) } diff --git a/command/agent/dns_test.go b/command/agent/dns_test.go index 1182d9172e..b65583a889 100644 --- a/command/agent/dns_test.go +++ b/command/agent/dns_test.go @@ -1744,27 +1744,6 @@ func TestDNS_ServiceLookup_OnlyPassing(t *testing.T) { if err := srv.agent.RPC("Catalog.Register", args3, &out); err != nil { t.Fatalf("err: %v", err) } - - args4 := &structs.RegisterRequest{ - Datacenter: "dc1", - Node: "quux", - Address: "127.0.0.4", - Service: &structs.NodeService{ - Service: "db", - Tags: []string{"master"}, - Port: 12345, - }, - Check: &structs.HealthCheck{ - CheckID: "db", - Name: "db", - ServiceID: "db", - Status: structs.HealthUnknown, - }, - } - - if err := srv.agent.RPC("Catalog.Register", args4, &out); err != nil { - t.Fatalf("err: %v", err) - } } // Register an equivalent prepared query. diff --git a/consul/structs/structs.go b/consul/structs/structs.go index 4f99399b38..39e34f6592 100644 --- a/consul/structs/structs.go +++ b/consul/structs/structs.go @@ -53,7 +53,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"