Skip to content

Commit 75ea01d

Browse files
authored
TeamsUpdate - fixing small bug, again missing update (#417)
* fixing small bug, again missing update * codeowners
1 parent 1e45aae commit 75ea01d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Global rule
2+
* @themantissa
3+
4+
# examples
5+
/examples/** @nikhil-mongo
6+
7+
# resources & datasources, provider
8+
/mongodbatlas/** @coderGo93 @leofigy

mongodbatlas/resource_mongodbatlas_team.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ func resourceMongoDBAtlasTeamRead(d *schema.ResourceData, meta interface{}) erro
8585
teamID := ids["id"]
8686

8787
team, _, err := conn.Teams.Get(context.Background(), orgID, teamID)
88+
8889
if err != nil {
90+
// new resource missing
91+
reset := strings.Contains(err.Error(), "404") && !d.IsNewResource()
92+
if reset {
93+
d.SetId("")
94+
return nil
95+
}
8996
return fmt.Errorf(errorTeamRead, err)
9097
}
9198

0 commit comments

Comments
 (0)