Skip to content

Commit

Permalink
Fix beta self_links, nested read in Snapshot. (hashicorp#188)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and rileykarson committed Dec 7, 2018
1 parent adc5475 commit fecdc3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions google-beta/resource_compute_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,10 @@ func expandComputeSnapshotSourceDiskEncryptionKey(v interface{}, d *schema.Resou
}

func resourceComputeSnapshotDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
d.Set("source_disk_link", res["sourceDisk"])
d.Set("snapshot_encryption_key_sha256", res["snapshotEncryptionKey"].((map[string]interface{}))["sha256"])
d.Set("source_disk_link", ConvertSelfLinkToV1(res["sourceDisk"].(string)))
if snapshotEncryptionKey := res["snapshotEncryptionKey"]; snapshotEncryptionKey != nil {
d.Set("snapshot_encryption_key_sha256", snapshotEncryptionKey.((map[string]interface{}))["sha256"])
}

return res, nil
}

0 comments on commit fecdc3e

Please sign in to comment.