Skip to content

Commit

Permalink
Add retry to removing GKE default node pool (#799)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and chrisst committed Jun 3, 2019
1 parent 9e07d16 commit 738c4fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions google-beta/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,16 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er

if d.Get("remove_default_node_pool").(bool) {
parent := fmt.Sprintf("%s/nodePools/%s", containerClusterFullName(project, location, clusterName), "default-pool")
op, err = config.clientContainerBeta.Projects.Locations.Clusters.NodePools.Delete(parent).Do()
err = retry(func() error {
op, err = config.clientContainerBeta.Projects.Locations.Clusters.NodePools.Delete(parent).Do()
return err
})
if err != nil {
return errwrap.Wrapf("Error deleting default node pool: {{err}}", err)
}
err = containerOperationWait(config, op, project, location, "removing default node pool", timeoutInMinutes)
if err != nil {
return errwrap.Wrapf("Error deleting default node pool: {{err}}", err)
return errwrap.Wrapf("Error while waiting to delete default node pool: {{err}}", err)
}
}

Expand Down

0 comments on commit 738c4fb

Please sign in to comment.