Skip to content

Commit

Permalink
openstack_images_image_v2: Update image settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fitbeard committed Jan 4, 2022
1 parent b83b21e commit 5e13eea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions openstack/resource_openstack_images_image_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,30 @@ func resourceImagesImageV2Update(ctx context.Context, d *schema.ResourceData, me
updateOpts = append(updateOpts, v)
}

if d.HasChange("protected") {
protected := d.Get("protected").(bool)
v := images.ReplaceImageProtected{NewProtected: protected}
updateOpts = append(updateOpts, v)
}

if d.HasChange("hidden") {
hidden := d.Get("hidden").(bool)
v := images.ReplaceImageHidden{NewHidden: hidden}
updateOpts = append(updateOpts, v)
}

if d.HasChange("min_disk_gb") {
min_disk_gb := d.Get("min_disk_gb").(int)
v := images.ReplaceImageMinDisk{NewMinDisk: min_disk_gb}
updateOpts = append(updateOpts, v)
}

if d.HasChange("min_ram_mb") {
min_ram_mb := d.Get("min_ram_mb").(int)
v := images.ReplaceImageMinRam{NewMinRam: min_ram_mb}
updateOpts = append(updateOpts, v)
}

if d.HasChange("name") {
v := images.ReplaceImageName{NewName: d.Get("name").(string)}
updateOpts = append(updateOpts, v)
Expand Down

0 comments on commit 5e13eea

Please sign in to comment.