From 28bd93e915ac99a363fae94def5d5c29fce96133 Mon Sep 17 00:00:00 2001 From: absolutelightning Date: Wed, 4 Oct 2023 17:20:58 +0530 Subject: [PATCH] fix intentions --- consul/resource_consul_config_entry_service_intentions.go | 8 +++++--- ...urce_consul_config_entry_service_intentions_ce_test.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/consul/resource_consul_config_entry_service_intentions.go b/consul/resource_consul_config_entry_service_intentions.go index a8e1210b..68928d39 100644 --- a/consul/resource_consul_config_entry_service_intentions.go +++ b/consul/resource_consul_config_entry_service_intentions.go @@ -309,8 +309,9 @@ func (s *serviceIntentions) Decode(d *schema.ResourceData) (consulapi.ConfigEntr } verifyClaims = append(verifyClaims, verifyClaim) } + provider.VerifyClaims = verifyClaims } - providerList = append(providerList, provider) + providers = append(providers, provider) } jwtReq.Providers = providers configEntry.JWT = jwtReq @@ -323,6 +324,7 @@ func (s *serviceIntentions) Decode(d *schema.ResourceData) (consulapi.ConfigEntr sourcesIntentions := make([]*consulapi.SourceIntention, 0) for _, sr := range sourcesList { var sourceIntention *consulapi.SourceIntention + sourceIntention = new(consulapi.SourceIntention) sourceMap := sr.(map[string]interface{}) if sourceMap["name"] != nil { sourceIntention.Name = sourceMap["name"].(string) @@ -432,8 +434,8 @@ func (s *serviceIntentions) Decode(d *schema.ResourceData) (consulapi.ConfigEntr } if sourceMap["legacy_meta"] != nil { legacyMeta := make(map[string]string) - for k, v := range sourceMap["legacy_meta"].(map[string]string) { - legacyMeta[k] = v + for k, v := range sourceMap["legacy_meta"].(map[string]interface{}) { + legacyMeta[k] = v.(string) } sourceIntention.LegacyMeta = legacyMeta } diff --git a/consul/resource_consul_config_entry_service_intentions_ce_test.go b/consul/resource_consul_config_entry_service_intentions_ce_test.go index 8917a012..ca1ee4d9 100644 --- a/consul/resource_consul_config_entry_service_intentions_ce_test.go +++ b/consul/resource_consul_config_entry_service_intentions_ce_test.go @@ -25,5 +25,5 @@ func TestAccConsulConfigEntryServiceIntentionsCETest(t *testing.T) { } const testConsulConfigEntryServiceIntentionsCE = ` - + resource `