From 0a7cf6aa4874b12d88c7fda190c83e7381635d31 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 22 Mar 2022 09:38:58 +1100 Subject: [PATCH] fix test and schema --- cloudflare/resource_cloudflare_spectrum_application.go | 2 +- cloudflare/resource_cloudflare_spectrum_application_test.go | 5 ++--- cloudflare/schema_cloudflare_spectrum_application.go | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudflare/resource_cloudflare_spectrum_application.go b/cloudflare/resource_cloudflare_spectrum_application.go index 3ab19c00b5..8eae7f5055 100644 --- a/cloudflare/resource_cloudflare_spectrum_application.go +++ b/cloudflare/resource_cloudflare_spectrum_application.go @@ -113,7 +113,7 @@ func resourceCloudflareSpectrumApplicationRead(d *schema.ResourceData, meta inte if err := d.Set("edge_ips", flattenEdgeIPs(application.EdgeIPs)); err != nil { log.Printf("[WARN] Error setting Edge IPs on spectrum application %q: %s", d.Id(), err) } - if err := d.Set("edge_ip_connectivity", application.EdgeIPs.Connectivity); err != nil { + if err := d.Set("edge_ip_connectivity", application.EdgeIPs.Connectivity.String()); err != nil { log.Printf("[WARN] Error setting Edge IP connectivity on spectrum application %q: %s", d.Id(), err) } } diff --git a/cloudflare/resource_cloudflare_spectrum_application_test.go b/cloudflare/resource_cloudflare_spectrum_application_test.go index 8ac1ca7b5e..b4c7a0c7d4 100644 --- a/cloudflare/resource_cloudflare_spectrum_application_test.go +++ b/cloudflare/resource_cloudflare_spectrum_application_test.go @@ -404,9 +404,8 @@ resource "cloudflare_spectrum_application" "%[3]s" { name = "%[3]s.%[2]s" } - origin_dns { - name = "%[3]s.origin.%[2]s" - } + origin_direct = ["tcp://1.2.3.4:23"] + origin_port = 22 edge_ip_connectivity = "ipv4" }`, zoneID, zoneName, ID) } diff --git a/cloudflare/schema_cloudflare_spectrum_application.go b/cloudflare/schema_cloudflare_spectrum_application.go index d16f9fa763..a77e16e468 100644 --- a/cloudflare/schema_cloudflare_spectrum_application.go +++ b/cloudflare/schema_cloudflare_spectrum_application.go @@ -125,6 +125,7 @@ func resourceCloudflareSpectrumApplicationSchema() map[string]*schema.Schema { "edge_ip_connectivity": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice([]string{ "all", "ipv4", "ipv6", }, false),