Skip to content

Commit

Permalink
Always set Formation quantity from the resource’s attribute (#352)
Browse files Browse the repository at this point in the history
* Always set Formation quantity from the resource’s attribute

* Always set Formation quantity, not size, from the resource’s attribute
  • Loading branch information
mars authored Dec 6, 2022
1 parent a412a52 commit 1efe13b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions heroku/resource_heroku_formation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1efe13b

Please sign in to comment.