Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgupta42 committed Jan 6, 2025
1 parent 34a99db commit f74f64b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
15 changes: 9 additions & 6 deletions upup/pkg/fi/cloudup/azuretasks/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Disk struct {
ResourceGroup *ResourceGroup
SizeGB *int32
Tags map[string]*string
VolumeType *compute.DiskStorageAccountTypes
VolumeType *string
Zones []*string
}

Expand Down Expand Up @@ -74,10 +74,13 @@ func (d *Disk) Find(c *fi.CloudupContext) (*Disk, error) {
ResourceGroup: &ResourceGroup{
Name: d.ResourceGroup.Name,
},
SizeGB: found.Properties.DiskSizeGB,
Tags: found.Tags,
VolumeType: found.SKU.Name,
Zones: found.Zones,
SizeGB: found.Properties.DiskSizeGB,
Tags: found.Tags,
Zones: found.Zones,
}
if found.SKU != nil && found.SKU.Name != nil {
volumeType := string(*found.SKU.Name)
disk.VolumeType = &volumeType
}
if found.Properties != nil {
disk.SizeGB = found.Properties.DiskSizeGB
Expand Down Expand Up @@ -131,7 +134,7 @@ func (*Disk) RenderAzure(t *azure.AzureAPITarget, a, e, changes *Disk) error {
DiskSizeGB: e.SizeGB,
},
SKU: &compute.DiskSKU{
Name: e.VolumeType,
Name: (*compute.DiskStorageAccountTypes)(e.VolumeType),
},
Tags: e.Tags,
Zones: e.Zones,
Expand Down
11 changes: 5 additions & 6 deletions upup/pkg/fi/cloudup/azuretasks/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ import (
)

const (
testTagKey = "key"
testTagValue = "value"
testTagKey = "key"
testTagValue = "value"
testVolumeType = "StandardSSD_LRS"
)

func newTestDisk() *Disk {
Expand All @@ -40,10 +41,8 @@ func newTestDisk() *Disk {
ResourceGroup: &ResourceGroup{
Name: to.Ptr("rg"),
},
SizeGB: to.Ptr[int32](32),
VolumeType: &compute.DiskSKU{
Name: to.Ptr(compute.DiskStorageAccountTypesStandardSSDLRS),
},
SizeGB: to.Ptr[int32](32),
VolumeType: to.Ptr(testVolumeType),
Tags: map[string]*string{
testTagKey: to.Ptr(testTagValue),
},
Expand Down

0 comments on commit f74f64b

Please sign in to comment.