Skip to content

Commit

Permalink
Upgrading to v21.0.0 of github.com/Azure/azure-sdk-for-go (#1996)
Browse files Browse the repository at this point in the history
* Upgrading to v21.0.0 of github.com/Azure/azure-sdk-for-go

* Code changes needed for sdkv21
  • Loading branch information
tombuildsstuff authored Sep 30, 2018
1 parent 642db47 commit 7606008
Show file tree
Hide file tree
Showing 28 changed files with 3,832 additions and 430 deletions.
2 changes: 1 addition & 1 deletion azurerm/data_source_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func dataSourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error {

d.SetId(*resp.ID)

if props := resp.DiskProperties; props != nil {
if props := resp.SnapshotProperties; props != nil {
d.Set("os_type", string(props.OsType))
d.Set("time_created", props.TimeCreated.String())

Expand Down
20 changes: 10 additions & 10 deletions azurerm/resource_arm_managed_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ func resourceArmManagedDisk() *schema.Resource {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
string(compute.StorageAccountTypesStandardLRS),
string(compute.StorageAccountTypesPremiumLRS),
string(compute.StorageAccountTypesStandardSSDLRS),
string(compute.StandardLRS),
string(compute.PremiumLRS),
string(compute.StandardSSDLRS),
}, true),
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},
Expand Down Expand Up @@ -124,13 +124,13 @@ func resourceArmManagedDiskCreate(d *schema.ResourceData, meta interface{}) erro
expandedTags := expandTags(tags)
zones := expandZones(d.Get("zones").([]interface{}))

var skuName compute.StorageAccountTypes
if strings.EqualFold(storageAccountType, string(compute.StorageAccountTypesPremiumLRS)) {
skuName = compute.StorageAccountTypesPremiumLRS
} else if strings.EqualFold(storageAccountType, string(compute.StorageAccountTypesStandardLRS)) {
skuName = compute.StorageAccountTypesStandardLRS
} else if strings.EqualFold(storageAccountType, string(compute.StorageAccountTypesStandardSSDLRS)) {
skuName = compute.StorageAccountTypesStandardSSDLRS
var skuName compute.DiskStorageAccountTypes
if strings.EqualFold(storageAccountType, string(compute.PremiumLRS)) {
skuName = compute.PremiumLRS
} else if strings.EqualFold(storageAccountType, string(compute.StandardLRS)) {
skuName = compute.StandardLRS
} else if strings.EqualFold(storageAccountType, string(compute.StandardSSDLRS)) {
skuName = compute.StandardSSDLRS
}

createDisk := compute.Disk{
Expand Down
12 changes: 6 additions & 6 deletions azurerm/resource_arm_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func resourceArmSnapshotCreateUpdate(d *schema.ResourceData, meta interface{}) e

properties := compute.Snapshot{
Location: utils.String(location),
DiskProperties: &compute.DiskProperties{
SnapshotProperties: &compute.SnapshotProperties{
CreationData: &compute.CreationData{
CreateOption: compute.DiskCreateOption(createOption),
},
Expand All @@ -95,20 +95,20 @@ func resourceArmSnapshotCreateUpdate(d *schema.ResourceData, meta interface{}) e
}

if v, ok := d.GetOk("source_uri"); ok {
properties.DiskProperties.CreationData.SourceURI = utils.String(v.(string))
properties.SnapshotProperties.CreationData.SourceURI = utils.String(v.(string))
}

if v, ok := d.GetOk("source_resource_id"); ok {
properties.DiskProperties.CreationData.SourceResourceID = utils.String(v.(string))
properties.SnapshotProperties.CreationData.SourceResourceID = utils.String(v.(string))
}

if v, ok := d.GetOk("storage_account_id"); ok {
properties.DiskProperties.CreationData.StorageAccountID = utils.String(v.(string))
properties.SnapshotProperties.CreationData.StorageAccountID = utils.String(v.(string))
}

diskSizeGB := d.Get("disk_size_gb").(int)
if diskSizeGB > 0 {
properties.DiskProperties.DiskSizeGB = utils.Int32(int32(diskSizeGB))
properties.SnapshotProperties.DiskSizeGB = utils.Int32(int32(diskSizeGB))
}

if v, ok := d.GetOk("encryption_settings"); ok {
Expand Down Expand Up @@ -166,7 +166,7 @@ func resourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error {
d.Set("location", azureRMNormalizeLocation(*location))
}

if props := resp.DiskProperties; props != nil {
if props := resp.SnapshotProperties; props != nil {

if data := props.CreationData; data != nil {
d.Set("create_option", string(data.CreateOption))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func resourceArmVirtualMachineDataDiskAttachmentCreateUpdate(d *schema.ResourceD
Lun: utils.Int32(lun),
ManagedDisk: &compute.ManagedDiskParameters{
ID: utils.String(managedDiskId),
StorageAccountType: managedDisk.Sku.Name,
StorageAccountType: compute.StorageAccountTypes(string(managedDisk.Sku.Name)),
},
WriteAcceleratorEnabled: utils.Bool(writeAcceleratorEnabled),
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7606008

Please sign in to comment.