Skip to content

Commit

Permalink
fix: fixed issue #68: now remove ip whitelist manually en re-create t…
Browse files Browse the repository at this point in the history
…he plan works fine
  • Loading branch information
PacoDw committed Jan 15, 2020
1 parent 8756d17 commit 029a297
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mongodbatlas/resource_mongodbatlas_project_ip_whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,15 @@ func resourceMongoDBAtlasProjectIPWhitelistRead(d *schema.ResourceData, meta int

whitelist, _, err := conn.ProjectIPWhitelist.Get(context.Background(), ids["project_id"], ids["entry"])
if err != nil {
if strings.Contains(fmt.Sprint(err), "500") || strings.Contains(fmt.Sprint(err), "404") {
switch {
case strings.Contains(fmt.Sprint(err), "500"):
return resource.RetryableError(err)
case strings.Contains(fmt.Sprint(err), "404"):
d.SetId("")
return nil
default:
return resource.NonRetryableError(fmt.Errorf(errorWhitelistRead, err))
}
return resource.NonRetryableError(fmt.Errorf(errorWhitelistRead, err))
}

if whitelist != nil {
Expand Down

0 comments on commit 029a297

Please sign in to comment.