Remove service_subset field from ingress config entry

We decided that this was not a useful MVP feature, and just added
unnecessary complexity
This commit is contained in:
Chris Piraino 2020-04-23 09:33:33 -05:00
parent e4268c8b7f
commit 837d2aa7d2
5 changed files with 9 additions and 29 deletions

View File

@ -385,13 +385,11 @@ func ConfigEntryDecodeRulesForKind(kind string) (skipWhenPatching []string, tran
}, nil }, nil
case IngressGateway: case IngressGateway:
return []string{ return []string{
"listeners", "listeners",
"Listeners", "Listeners",
"listeners.services", "listeners.services",
"Listeners.Services", "Listeners.Services",
}, map[string]string{ }, nil, nil
"service_subset": "servicesubset",
}, nil
case TerminatingGateway: case TerminatingGateway:
return []string{ return []string{
"services", "services",

View File

@ -51,11 +51,6 @@ type IngressService struct {
// protocol and means that the listener will forward traffic to all services. // protocol and means that the listener will forward traffic to all services.
Name string 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"` EnterpriseMeta `hcl:",squash" mapstructure:",squash"`
} }

View File

@ -566,7 +566,6 @@ func TestDecodeConfigEntry(t *testing.T) {
services = [ services = [
{ {
name = "postgres" name = "postgres"
service_subset = "v1"
} }
] ]
} }
@ -603,7 +602,6 @@ func TestDecodeConfigEntry(t *testing.T) {
Services = [ Services = [
{ {
Name = "postgres" Name = "postgres"
ServiceSubset = "v1"
} }
] ]
} }
@ -639,8 +637,7 @@ func TestDecodeConfigEntry(t *testing.T) {
Protocol: "tcp", Protocol: "tcp",
Services: []IngressService{ Services: []IngressService{
IngressService{ IngressService{
Name: "postgres", Name: "postgres",
ServiceSubset: "v1",
}, },
}, },
}, },

View File

@ -60,11 +60,6 @@ type IngressService struct {
// Namespace is the namespace where the service is located. // Namespace is the namespace where the service is located.
// Namespacing is a Consul Enterprise feature. // Namespacing is a Consul Enterprise feature.
Namespace string `json:",omitempty"` 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 { func (i *IngressGatewayConfigEntry) GetKind() string {

View File

@ -1395,7 +1395,6 @@ func TestParseConfigEntry(t *testing.T) {
services = [ services = [
{ {
name = "web" name = "web"
service_subset = "v1"
}, },
{ {
name = "db" name = "db"
@ -1415,7 +1414,6 @@ func TestParseConfigEntry(t *testing.T) {
Services = [ Services = [
{ {
Name = "web" Name = "web"
ServiceSubset = "v1"
}, },
{ {
Name = "db" Name = "db"
@ -1435,8 +1433,7 @@ func TestParseConfigEntry(t *testing.T) {
"protocol": "http", "protocol": "http",
"services": [ "services": [
{ {
"name": "web", "name": "web"
"service_subset": "v1"
}, },
{ {
"name": "db", "name": "db",
@ -1457,8 +1454,7 @@ func TestParseConfigEntry(t *testing.T) {
"Protocol": "http", "Protocol": "http",
"Services": [ "Services": [
{ {
"Name": "web", "Name": "web"
"ServiceSubset": "v1"
}, },
{ {
"Name": "db", "Name": "db",
@ -1478,8 +1474,7 @@ func TestParseConfigEntry(t *testing.T) {
Protocol: "http", Protocol: "http",
Services: []api.IngressService{ Services: []api.IngressService{
{ {
Name: "web", Name: "web",
ServiceSubset: "v1",
}, },
{ {
Name: "db", Name: "db",