From 75ea01dcb37f61cedcf4fb1c8c68ed0247b66eec Mon Sep 17 00:00:00 2001 From: leofigy <49299001+leofigy@users.noreply.github.com> Date: Mon, 1 Mar 2021 17:47:00 -0600 Subject: [PATCH] TeamsUpdate - fixing small bug, again missing update (#417) * fixing small bug, again missing update * codeowners --- .github/CODEOWNERS | 8 ++++++++ mongodbatlas/resource_mongodbatlas_team.go | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..8b21a4c592 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# Global rule +* @themantissa + +# examples +/examples/** @nikhil-mongo + +# resources & datasources, provider +/mongodbatlas/** @coderGo93 @leofigy diff --git a/mongodbatlas/resource_mongodbatlas_team.go b/mongodbatlas/resource_mongodbatlas_team.go index 5e05ab1922..5105c56489 100644 --- a/mongodbatlas/resource_mongodbatlas_team.go +++ b/mongodbatlas/resource_mongodbatlas_team.go @@ -85,7 +85,14 @@ func resourceMongoDBAtlasTeamRead(d *schema.ResourceData, meta interface{}) erro teamID := ids["id"] team, _, err := conn.Teams.Get(context.Background(), orgID, teamID) + if err != nil { + // new resource missing + reset := strings.Contains(err.Error(), "404") && !d.IsNewResource() + if reset { + d.SetId("") + return nil + } return fmt.Errorf(errorTeamRead, err) }