From b5ad886affbcdf650040b946330bda87e69927cb Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 29 Aug 2023 07:00:47 +1000 Subject: [PATCH] generate: skip `queuing_status_code` attribute when 0 This is unusable in the API so it shouldn't be outputted. --- internal/app/cf-terraforming/cmd/generate.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/app/cf-terraforming/cmd/generate.go b/internal/app/cf-terraforming/cmd/generate.go index 932208100..4d3678f22 100644 --- a/internal/app/cf-terraforming/cmd/generate.go +++ b/internal/app/cf-terraforming/cmd/generate.go @@ -957,6 +957,12 @@ func generateResources() func(cmd *cobra.Command, args []string) { if err != nil { log.Fatal(err) } + + for i := 0; i < resourceCount; i++ { + if jsonStructData[i].(map[string]interface{})["queueing_status_code"].(float64) == 0 { + jsonStructData[i].(map[string]interface{})["queueing_status_code"] = nil + } + } case "cloudflare_workers_kv_namespace": jsonPayload, _, err := api.ListWorkersKVNamespaces(context.Background(), identifier, cloudflare.ListWorkersKVNamespacesParams{}) if err != nil {