From 8fd2c0a6b61e3c78550c6d35503e01346f6091d5 Mon Sep 17 00:00:00 2001 From: absolutelightning Date: Wed, 27 Sep 2023 15:00:10 +0530 Subject: [PATCH] removed kind --- ...esource_consul_service_defaults_config_entry.go | 14 +++----------- ...esource_consul_service_splitter_config_entry.go | 14 +++----------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/consul/resource_consul_service_defaults_config_entry.go b/consul/resource_consul_service_defaults_config_entry.go index a81dfa62..6ba63471 100644 --- a/consul/resource_consul_service_defaults_config_entry.go +++ b/consul/resource_consul_service_defaults_config_entry.go @@ -115,12 +115,6 @@ var upstreamConfigSchema = &schema.Resource{ } var serviceDefaultsConfigEntrySchema = map[string]*schema.Schema{ - "kind": { - Type: schema.TypeString, - Required: false, - ForceNew: true, - Computed: true, - }, "name": { Type: schema.TypeString, @@ -334,23 +328,21 @@ func resourceServiceDefaultsConfigEntry() *schema.Resource { Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") - var kind, name, partition, namespace string + var name, partition, namespace string switch len(parts) { case 2: - kind = parts[0] name = parts[1] case 4: partition = parts[0] namespace = parts[1] - kind = parts[2] name = parts[3] default: return nil, fmt.Errorf(`expected path of the form "/" or "///"`) } - d.SetId(fmt.Sprintf("%s-%s", kind, name)) + d.SetId(fmt.Sprintf("%s-%s", KindServiceDefaults, name)) sw := newStateWriter(d) - sw.set("kind", kind) + sw.set("kind", KindServiceDefaults) sw.set("name", name) sw.set("partition", partition) sw.set("namespace", namespace) diff --git a/consul/resource_consul_service_splitter_config_entry.go b/consul/resource_consul_service_splitter_config_entry.go index b2200d05..ae7abf06 100644 --- a/consul/resource_consul_service_splitter_config_entry.go +++ b/consul/resource_consul_service_splitter_config_entry.go @@ -19,12 +19,6 @@ var serviceSplitterConfigEntrySchema = map[string]*schema.Schema{ Required: true, ForceNew: true, }, - "kind": { - Type: schema.TypeString, - Required: false, - ForceNew: true, - Computed: true, - }, "partition": { Type: schema.TypeString, Optional: true, @@ -126,23 +120,21 @@ func resourceServiceSplitterConfigEntry() *schema.Resource { Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") - var kind, name, partition, namespace string + var name, partition, namespace string switch len(parts) { case 2: - kind = parts[0] name = parts[1] case 4: partition = parts[0] namespace = parts[1] - kind = parts[2] name = parts[3] default: return nil, fmt.Errorf(`expected path of the form "/" or "///"`) } - d.SetId(fmt.Sprintf("%s-%s", kind, name)) + d.SetId(fmt.Sprintf("%s-%s", KindServiceSplitter, name)) sw := newStateWriter(d) - sw.set("kind", kind) + sw.set("kind", KindServiceSplitter) sw.set("name", name) sw.set("partition", partition) sw.set("namespace", namespace)