Skip to content

Commit

Permalink
Trying out fixes for scale set sku tier casing issue hashicorp#11626
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijeet Gaiha committed May 10, 2017
1 parent 1366980 commit fcf2b2b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"log"
"net/http"

"strings"

"github.com/Azure/azure-sdk-for-go/arm/compute"
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/schema"
Expand Down Expand Up @@ -45,14 +47,16 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},

"tier": {
Type: schema.TypeString,
Optional: true,
Computed: true,
// Computed: true,
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},

"capacity": {
Expand Down Expand Up @@ -771,9 +775,11 @@ func flattenAzureRmVirtualMachineScaleSetSku(sku *compute.Sku) []interface{} {
result["capacity"] = *sku.Capacity

if *sku.Tier != "" {
result["tier"] = *sku.Tier
result["tier"] = strings.ToLower(*sku.Tier)

This comment has been minimized.

Copy link
@StephenWeatherford

StephenWeatherford May 11, 2017

Collaborator

I'd rather standardize on Pascal casing, so let's not do this. If Azure is returning it Pascal cased, let's leave it that way.

}

log.Printf("[DEBUG] agaiha sku values, Name:(%s), Capacity:(%d), Tier:(%s)", *sku.Name, *sku.Capacity, *sku.Tier)

return []interface{}{result}
}

Expand Down

0 comments on commit fcf2b2b

Please sign in to comment.