Skip to content

Commit

Permalink
move setid calls back
Browse files Browse the repository at this point in the history
  • Loading branch information
danawillow committed Mar 14, 2018
1 parent 49f9757 commit 0c7b2db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,6 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
}
}

d.SetId(clusterName)

// Wait until it's created
waitErr := containerSharedOperationWait(config, op, project, zoneName, "creating GKE cluster", timeoutInMinutes, 3)
if waitErr != nil {
Expand All @@ -579,6 +577,8 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er

log.Printf("[INFO] GKE cluster %s has been created", clusterName)

d.SetId(clusterName)

return resourceContainerClusterRead(d, meta)
}

Expand Down
4 changes: 2 additions & 2 deletions google/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ func resourceContainerNodePoolCreate(d *schema.ResourceData, meta interface{}) e
}
}

d.SetId(fmt.Sprintf("%s/%s/%s", zone, cluster, nodePool.Name))

timeoutInMinutes := int(d.Timeout(schema.TimeoutCreate).Minutes())
waitErr := containerSharedOperationWait(config, op, project, zone, "creating GKE NodePool", timeoutInMinutes, 3)
if waitErr != nil {
Expand All @@ -201,6 +199,8 @@ func resourceContainerNodePoolCreate(d *schema.ResourceData, meta interface{}) e

log.Printf("[INFO] GKE NodePool %s has been created", nodePool.Name)

d.SetId(fmt.Sprintf("%s/%s/%s", zone, cluster, nodePool.Name))

return resourceContainerNodePoolRead(d, meta)
}

Expand Down

0 comments on commit 0c7b2db

Please sign in to comment.