-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add nic_list_status to separate the computed values #40
Conversation
"subnet_name": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this attributes are only computed right?
@@ -737,7 +813,10 @@ func resourceNutanixVirtualMachineRead(d *schema.ResourceData, meta interface{}) | |||
if err := d.Set("availability_zone_reference", flattenReferenceValues(resp.Status.AvailabilityZoneReference)); err != nil { | |||
return fmt.Errorf("error setting availability_zone_reference for Virtual Machine %s: %s", d.Id(), err) | |||
} | |||
if err := d.Set("nic_list", flattenNicList(resp.Status.Resources.NicList)); err != nil { | |||
if err := d.Set("nic_list", flattenNicList(resp.Spec.Resources.NicList)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nic_list_status
contains the output of the request and nic_list
contains the arguments to create the nics, I think you should not set them here nic_list
Also, can you add a test case for this? |
Yes I'd already added a test case for subnets/NICs in 1bf461b, let me cherry pick and modify for the new configuration. |
a477780
to
68963db
Compare
68963db
to
9eb7f20
Compare
Not gonna sign this off until we can try this on the lab environment. |
9d2dc6f
to
a8f8922
Compare
a8f8922
to
301201a
Compare
Assign categories to resources nutanix#40
closes #12 #17 #19
We added the nic_list_status attribute (computed) to show all the nic_list with the ip_endpoint_list from the Status object.
You could get the IP address by this: