Skip to content

Commit

Permalink
Fix compute project metadata error from previous "common_metadata" IDs (
Browse files Browse the repository at this point in the history
#2844)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and emilymye committed Jan 10, 2019
1 parent 461fb2a commit 601f6cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions google/resource_compute_project_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ func resourceComputeProjectMetadataCreateOrUpdate(d *schema.ResourceData, meta i
func resourceComputeProjectMetadataRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

if d.Id() == "" {
projectID, err := getProject(d, config)
if err != nil {
return err
}
projectID, err := getProject(d, config)
if err != nil {
return err
}

if d.Id() == "" || d.Id() != projectID {
log.Printf("[DEBUG] Setting ID to: %s", projectID)
d.SetId(projectID)
}

Expand Down

0 comments on commit 601f6cf

Please sign in to comment.