-
Notifications
You must be signed in to change notification settings - Fork 2
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
US69000: Adding support for new volume attributes in schema #217
Conversation
Please update your PR description about the non-released client version. |
@@ -326,6 +371,26 @@ func resourceMetalVolumeRead(d *schema.ResourceData, meta interface{}) (err erro | |||
return fmt.Errorf("set Size: %v", err) | |||
} | |||
|
|||
if err = d.Set(vSizeInUse, math.Round(float64(volume.CapacityUsed)/KiBToGBConversion)); err != nil { | |||
return fmt.Errorf("resourceMetalVolumeRead: set %s : %v", vSizeInUse, err) |
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.
I'd remove "resourceMetalVolumeRead" from the error messages to be more secure.
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.
As this is a public repo, I decided to put more context to the error on where it is coming from.
Anyway, I have removed the method names to align with other implementations.
Thanks.
Description:
Added new volume attributes from the client to the schema.
Client release - https://github.com/HewlettPackard/hpegl-metal-client/releases/tag/v1.5.21
Note: As fields are populated by the backend, they are marked as computed which will make sure the resources are not affected when a re-apply is issued.
Test:
State after creating the volume
tf.state.before.json
Start after refresh the volume post manually data population
tf.state.after.json
Diff of states post manual updates to db record
Re-apply of the resource