From 1efe13bf0c116e275c14b5df23d5a6a483337ee7 Mon Sep 17 00:00:00 2001 From: Mars Hall Date: Mon, 5 Dec 2022 17:28:32 -0800 Subject: [PATCH] =?UTF-8?q?Always=20set=20Formation=20quantity=20from=20th?= =?UTF-8?q?e=20resource=E2=80=99s=20attribute=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Always set Formation quantity from the resource’s attribute * Always set Formation quantity, not size, from the resource’s attribute --- heroku/resource_heroku_formation.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/heroku/resource_heroku_formation.go b/heroku/resource_heroku_formation.go index 405b759b..5f9c7874 100644 --- a/heroku/resource_heroku_formation.go +++ b/heroku/resource_heroku_formation.go @@ -113,11 +113,9 @@ func resourceHerokuFormationCreate(d *schema.ResourceData, meta interface{}) err opts.Size = &vs } - if v, ok := d.GetOk("quantity"); ok { - vs := v.(int) - log.Printf("[DEBUG] Quantity: %v", vs) - opts.Quantity = &vs - } + quantity := d.Get("quantity").(int) + log.Printf("[DEBUG] Quantity: %v", quantity) + opts.Quantity = &quantity log.Printf(fmt.Sprintf("[DEBUG] Updating %s formation...", appID)) f, err := client.FormationUpdate(context.TODO(), appID, getFormationType(d), opts)