When a user creates a VM with a VM template, and she does not have the "Organization vDC Disk: View IOPS" right, the VCD Provider crashes with a panic:
In code, it was assumed that the IOPS information was always present. The fix consists of safely checking for nil pointers.
Tests
A new test is provided: TestAccVcdVm_WithoutOrganizationVdcDiskIopsRights. This test will panic without this fix (hence will remove the Organization vDC Disk: View IOPS from your VCD testing org user, be careful and restore it afterwards).
With this patch, the test obviously should pass.
What it does, it removes the mentioned rights, applies the HCL, then restores the same rights.
This PR closes #1262
Problem
When a user creates a VM with a VM template, and she does not have the "Organization vDC Disk: View IOPS" right, the VCD Provider crashes with a panic:
HCL to reproduce:
Solution
In code, it was assumed that the IOPS information was always present. The fix consists of safely checking for
nil
pointers.Tests
A new test is provided:
TestAccVcdVm_WithoutOrganizationVdcDiskIopsRights
. This test will panic without this fix (hence will remove theOrganization vDC Disk: View IOPS
from your VCD testing org user, be careful and restore it afterwards). With this patch, the test obviously should pass.What it does, it removes the mentioned rights, applies the HCL, then restores the same rights.