@@ -50,6 +50,24 @@ func resourceGithubTeam() *schema.Resource {
50
50
Type : schema .TypeString ,
51
51
Optional : true ,
52
52
Description : "The ID or slug of the parent team, if this is a nested team." ,
53
+ DiffSuppressFunc : func (k , old , new string , d * schema.ResourceData ) bool {
54
+ if d .Get ("parent_team_id" ) == d .Get ("parent_team_read_id" ) || d .Get ("parent_team_id" ) == d .Get ("parent_team_read_slug" ) {
55
+ return true
56
+ }
57
+ return false
58
+ },
59
+ },
60
+ "parent_team_read_id" : {
61
+ Type : schema .TypeString ,
62
+ Optional : true ,
63
+ Computed : true ,
64
+ Description : "The id of the parent team read in Github." ,
65
+ },
66
+ "parent_team_read_slug" : {
67
+ Type : schema .TypeString ,
68
+ Optional : true ,
69
+ Computed : true ,
70
+ Description : "The id of the parent team read in Github." ,
53
71
},
54
72
"ldap_dn" : {
55
73
Type : schema .TypeString ,
@@ -196,7 +214,9 @@ func resourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error {
196
214
d .Set ("name" , team .GetName ())
197
215
d .Set ("privacy" , team .GetPrivacy ())
198
216
if parent := team .Parent ; parent != nil {
199
- d .Set ("parent_team_id" , parent .GetID ())
217
+ d .Set ("parent_team_id" , strconv .FormatInt (team .Parent .GetID (), 10 ))
218
+ d .Set ("parent_team_read_id" , strconv .FormatInt (team .Parent .GetID (), 10 ))
219
+ d .Set ("parent_team_read_slug" , parent .Slug )
200
220
} else {
201
221
d .Set ("parent_team_id" , "" )
202
222
}
@@ -305,6 +325,8 @@ func resourceGithubTeamImport(d *schema.ResourceData, meta interface{}) ([]*sche
305
325
}
306
326
307
327
d .SetId (strconv .FormatInt (teamId , 10 ))
328
+ d .Set ("create_default_maintainer" , false )
329
+
308
330
return []* schema.ResourceData {d }, nil
309
331
}
310
332
0 commit comments