From 6461087c25525a304a3d40a1a59552c8a65d981a Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 7 May 2018 15:51:05 -0700 Subject: [PATCH] Remove support for CheckID field in service check definitions --- agent/config/config.go | 12 +++++------- agent/config/runtime_test.go | 12 ++++++------ website/source/docs/agent/checks.html.md | 5 ----- website/source/docs/agent/services.html.md | 5 ----- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index 20db0cd282..8d4aa62552 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -94,14 +94,12 @@ func Parse(data string, format string) (c Config, err error) { // CamelCase and snake_case. Since changing either format would break // existing setups we have to support both and slowly transition to one of // the formats. Also, there is at least one case where we use the "wrong" - // key and want to map that to the new key to support deprecation - // (`check.id` vs `service.check.CheckID`) See [GH-3179]. TranslateKeys - // maps potentially CamelCased values to the snake_case that is used in the - // config file parser. If both the CamelCase and snake_case values are set, - // the snake_case value is used and the other value is discarded. + // key and want to map that to the new key to support deprecation - + // see [GH-3179]. TranslateKeys maps potentially CamelCased values to the + // snake_case that is used in the config file parser. If both the CamelCase + // and snake_case values are set the snake_case value is used and the other + // value is discarded. TranslateKeys(m, map[string]string{ - "check_id": "id", - "checkid": "id", "deregistercriticalserviceafter": "deregister_critical_service_after", "dockercontainerid": "docker_container_id", "enabletagoverride": "enable_tag_override", diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 78e7d577b1..9e7463a759 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1988,7 +1988,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { "port": 80, "EnableTagOverride": true, "check": { - "CheckID": "x", + "id": "x", "name": "y", "DockerContainerID": "z", "DeregisterCriticalServiceAfter": "10s", @@ -2003,7 +2003,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { port = 80 EnableTagOverride = true check = { - CheckID = "x" + id = "x" name = "y" DockerContainerID = "z" DeregisterCriticalServiceAfter = "10s" @@ -2445,7 +2445,7 @@ func TestFullConfig(t *testing.T) { "port": 24237, "enable_tag_override": true, "check": { - "check_id": "RMi85Dv8", + "id": "RMi85Dv8", "name": "iehanzuq", "status": "rCvn53TH", "notes": "fti5lfF3", @@ -2523,7 +2523,7 @@ func TestFullConfig(t *testing.T) { "port": 72219, "enable_tag_override": true, "check": { - "check_id": "qmfeO5if", + "id": "qmfeO5if", "name": "atDGP7n5", "status": "pDQKEhWL", "notes": "Yt8EDLev", @@ -2886,7 +2886,7 @@ func TestFullConfig(t *testing.T) { port = 24237 enable_tag_override = true check = { - check_id = "RMi85Dv8" + id = "RMi85Dv8" name = "iehanzuq" status = "rCvn53TH" notes = "fti5lfF3" @@ -2964,7 +2964,7 @@ func TestFullConfig(t *testing.T) { port = 72219 enable_tag_override = true check = { - check_id = "qmfeO5if" + id = "qmfeO5if" name = "atDGP7n5" status = "pDQKEhWL" notes = "Yt8EDLev" diff --git a/website/source/docs/agent/checks.html.md b/website/source/docs/agent/checks.html.md index a612d8a92a..42065e2799 100644 --- a/website/source/docs/agent/checks.html.md +++ b/website/source/docs/agent/checks.html.md @@ -197,11 +197,6 @@ and the check is embedded within a service definition a unique check id is generated. Otherwise, `id` will be set to `name`. If names might conflict, unique IDs should be provided. --> **Note:** Consul 0.9.3 and before require the optional check ID for a check - that is embedded in a service definition to be configured via the `CheckID` - field. Consul 1.0 accepts both `id` and `CheckID` but the latter is - deprecated and will be removed in Consul 1.1. - The `notes` field is opaque to Consul but can be used to provide a human-readable description of the current state of the check. With a script check, the field is set to any output generated by the script. Similarly, an external process updating diff --git a/website/source/docs/agent/services.html.md b/website/source/docs/agent/services.html.md index d01b85a0bf..0cd13740e1 100644 --- a/website/source/docs/agent/services.html.md +++ b/website/source/docs/agent/services.html.md @@ -90,11 +90,6 @@ from `1`. -> **Note:** There is more information about [checks here](/docs/agent/checks.html). --> **Note:** Consul 0.9.3 and before require the optional check ID for a check - that is embedded in a service definition to be configured via the `CheckID` - field. Consul 1.0 accepts both `id` and `CheckID` but the latter is - deprecated and will be removed in Consul 1.1. - The `enable_tag_override` can optionally be specified to disable the anti-entropy feature for this service. If `enable_tag_override` is set to `TRUE` then external agents can update this service in the