You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been searching about in both go-github and githubv4 Go modules, and I'm thinking that maybe the GitHub API doesn't provide this information, but thought I'd give it a shot here at least.
When associating a GitHub user with a team and that user is suspended (this is particularly useful with GitHub Enterprise Server situations), Terraform repeatedly tries to (successfully, however always shows a diff to add) continuously add that suspended user to the team. I was thinking that I could potentially use the github_user data source, however in looking at the attributes of the data source, I don't see suspended or some other state related attribute. Perhaps this may be because the GitHub API doesn't transport this information either?
My hope was to iterate through a variable the list of users, and collect their status. If that status resulted in suspended, I would remove them from a local, which is used to build the github_team_membership resource. This would allow for a cleaner, more automatic state of the team, and also allow me to potentially test/warn on the plan - "The following users are potentially suspended: [list of users]". This would tell them to remove the user's membership from the running plan, but still result in a cleaner situation, instead of always showing a diff in resources (repeated attempt to add suspended user to a team). Failure would still occur doing a lookup of a deleted or invalid user, and that's still acceptable.
Unsure if there's another plausible work-around in the github_team_membership resource...
Terraform Version
= 0.12.0
Provider version
~> 4.0
Affected Resource(s)
Please list the resources as a list, for example:
data.github_user
github_team_membership
Terraform Configuration Files
# Something to the effect ofvariable"members" {
type=map(string)
description="Map of username to role in team"default={}
}
data"github_user""user" {
for_each=var.membersusername=each.key
}
resource"github_team_membership""membership" {
for_each=[fork, vinvar.members: { k => v } ifdata.github_user.user[k].status!="suspended"]
username=each.keyrole=each.role
}
Debug Output
N/A
Panic Output
N/A
Expected Behavior
N/A
Actual Behavior
Suspended users added to a GitHub team are attempted to be re-added (silent failure masked as success)
Steps to Reproduce
Suspend GitHub user
terraform apply
Important Factoids
This is likely most relevent to GitHub Enterprise Server consumers, however there should be some kind of state information about the user - whether they're suspended or not.
References
N/A
The text was updated successfully, but these errors were encountered:
Greetings,
I've been searching about in both go-github and githubv4 Go modules, and I'm thinking that maybe the GitHub API doesn't provide this information, but thought I'd give it a shot here at least.
When associating a GitHub user with a team and that user is suspended (this is particularly useful with GitHub Enterprise Server situations), Terraform repeatedly tries to (successfully, however always shows a diff to add) continuously add that suspended user to the team. I was thinking that I could potentially use the
github_user
data source, however in looking at the attributes of the data source, I don't seesuspended
or some otherstate
related attribute. Perhaps this may be because the GitHub API doesn't transport this information either?My hope was to iterate through a variable the list of users, and collect their status. If that status resulted in
suspended
, I would remove them from a local, which is used to build thegithub_team_membership
resource. This would allow for a cleaner, more automatic state of the team, and also allow me to potentially test/warn on the plan - "The following users are potentially suspended: [list of users]". This would tell them to remove the user's membership from the running plan, but still result in a cleaner situation, instead of always showing a diff in resources (repeated attempt to add suspended user to a team). Failure would still occur doing a lookup of a deleted or invalid user, and that's still acceptable.Unsure if there's another plausible work-around in the
github_team_membership
resource...Terraform Version
Provider version
~> 4.0
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
N/A
Panic Output
N/A
Expected Behavior
N/A
Actual Behavior
Suspended users added to a GitHub team are attempted to be re-added (silent failure masked as success)
Steps to Reproduce
terraform apply
Important Factoids
This is likely most relevent to GitHub Enterprise Server consumers, however there should be some kind of state information about the user - whether they're suspended or not.
References
N/A
The text was updated successfully, but these errors were encountered: