Skip to content

Commit

Permalink
Improve the error message of boot volume retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
odaira committed Oct 16, 2019
1 parent 7d19957 commit 4a285c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ibm/resource_ibm_is_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,10 @@ func resourceIBMisInstanceRead(d *schema.ResourceData, meta interface{}) error {
bootVol := map[string]interface{}{}
bootVol[isInstanceBootName] = instance.BootVolumeAttachment.Name
stg := storage.NewStorageClient(sess)
vol, err := stg.Get(instance.BootVolumeAttachment.Volume.ID.String())
volId := instance.BootVolumeAttachment.Volume.ID.String()
vol, err := stg.Get(volId)
if err != nil {
return err
return fmt.Errorf("Error while retrieving boot volume %s for instance %s: %v", volId, d.Id(), err)
}
if vol.EncryptionKey != nil {
bootVol[isInstanceBootEncryption] = vol.EncryptionKey.Crn
Expand Down

0 comments on commit 4a285c7

Please sign in to comment.