Skip to content

Commit

Permalink
Add retry to removing GKE default node pool (#1867)
Browse files Browse the repository at this point in the history
Merged PR #1867.
  • Loading branch information
chrisst authored and modular-magician committed Jun 3, 2019
1 parent 9f583c9 commit ef081ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,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 ef081ae

Please sign in to comment.