From b73a13fc9e9cba90c039ebf6e0bd4151be66ba8b Mon Sep 17 00:00:00 2001 From: Chris Piraino Date: Thu, 23 Apr 2020 09:33:33 -0500 Subject: [PATCH] Remove service_subset field from ingress config entry We decided that this was not a useful MVP feature, and just added unnecessary complexity --- agent/structs/config_entry.go | 12 +++++------- agent/structs/config_entry_gateways.go | 5 ----- agent/structs/config_entry_test.go | 5 +---- api/config_entry_gateways.go | 5 ----- command/config/write/config_write_test.go | 11 +++-------- 5 files changed, 9 insertions(+), 29 deletions(-) diff --git a/agent/structs/config_entry.go b/agent/structs/config_entry.go index 6afbd6a8e2..8ec7d43271 100644 --- a/agent/structs/config_entry.go +++ b/agent/structs/config_entry.go @@ -385,13 +385,11 @@ func ConfigEntryDecodeRulesForKind(kind string) (skipWhenPatching []string, tran }, nil case IngressGateway: return []string{ - "listeners", - "Listeners", - "listeners.services", - "Listeners.Services", - }, map[string]string{ - "service_subset": "servicesubset", - }, nil + "listeners", + "Listeners", + "listeners.services", + "Listeners.Services", + }, nil, nil case TerminatingGateway: return []string{ "services", diff --git a/agent/structs/config_entry_gateways.go b/agent/structs/config_entry_gateways.go index 86374a7122..6c1563c5fc 100644 --- a/agent/structs/config_entry_gateways.go +++ b/agent/structs/config_entry_gateways.go @@ -51,11 +51,6 @@ type IngressService struct { // protocol and means that the listener will forward traffic to all services. Name string - // ServiceSubset declares the specific service subset to which traffic should - // be sent. This must match an existing service subset declared in a - // service-resolver config entry. - ServiceSubset string - EnterpriseMeta `hcl:",squash" mapstructure:",squash"` } diff --git a/agent/structs/config_entry_test.go b/agent/structs/config_entry_test.go index 88a6437cd5..a0eec8e5f4 100644 --- a/agent/structs/config_entry_test.go +++ b/agent/structs/config_entry_test.go @@ -566,7 +566,6 @@ func TestDecodeConfigEntry(t *testing.T) { services = [ { name = "postgres" - service_subset = "v1" } ] } @@ -603,7 +602,6 @@ func TestDecodeConfigEntry(t *testing.T) { Services = [ { Name = "postgres" - ServiceSubset = "v1" } ] } @@ -639,8 +637,7 @@ func TestDecodeConfigEntry(t *testing.T) { Protocol: "tcp", Services: []IngressService{ IngressService{ - Name: "postgres", - ServiceSubset: "v1", + Name: "postgres", }, }, }, diff --git a/api/config_entry_gateways.go b/api/config_entry_gateways.go index d3469078ef..f6babe205b 100644 --- a/api/config_entry_gateways.go +++ b/api/config_entry_gateways.go @@ -60,11 +60,6 @@ type IngressService struct { // Namespace is the namespace where the service is located. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` - - // ServiceSubset declares the specific service subset to which traffic should - // be sent. This must match an existing service subset declared in a - // service-resolver config entry. - ServiceSubset string } func (i *IngressGatewayConfigEntry) GetKind() string { diff --git a/command/config/write/config_write_test.go b/command/config/write/config_write_test.go index 40abf7eef2..01f9b360ee 100644 --- a/command/config/write/config_write_test.go +++ b/command/config/write/config_write_test.go @@ -1395,7 +1395,6 @@ func TestParseConfigEntry(t *testing.T) { services = [ { name = "web" - service_subset = "v1" }, { name = "db" @@ -1415,7 +1414,6 @@ func TestParseConfigEntry(t *testing.T) { Services = [ { Name = "web" - ServiceSubset = "v1" }, { Name = "db" @@ -1435,8 +1433,7 @@ func TestParseConfigEntry(t *testing.T) { "protocol": "http", "services": [ { - "name": "web", - "service_subset": "v1" + "name": "web" }, { "name": "db", @@ -1457,8 +1454,7 @@ func TestParseConfigEntry(t *testing.T) { "Protocol": "http", "Services": [ { - "Name": "web", - "ServiceSubset": "v1" + "Name": "web" }, { "Name": "db", @@ -1478,8 +1474,7 @@ func TestParseConfigEntry(t *testing.T) { Protocol: "http", Services: []api.IngressService{ { - Name: "web", - ServiceSubset: "v1", + Name: "web", }, { Name: "db",