-
Notifications
You must be signed in to change notification settings - Fork 1k
[BUG]: fix lowercase permadiff team members #3539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ee8e99a
3ce6b45
b2a82f4
8fc4fc0
a2d5533
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,13 +63,21 @@ func resourceGithubTeamMembers() *schema.Resource { | |
| Type: schema.TypeSet, | ||
| Required: true, | ||
| Description: "List of users that should be members of the team.", | ||
| Set: func(v any) int { | ||
| username, _ := v.(map[string]any)["username"].(string) | ||
| return schema.HashString(strings.ToLower(username)) | ||
| }, | ||
| Elem: &schema.Resource{ | ||
| Schema: map[string]*schema.Schema{ | ||
| "username": { | ||
| Type: schema.TypeString, | ||
| Required: true, | ||
| DiffSuppressFunc: caseInsensitive(), | ||
| Description: "User to add to the team.", | ||
| StateFunc: func(v any) string { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, importing a mixed-case username will create a diff.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, because the code is missing a check to reconcile the config members with the actual members as lower case. So we don't need this, but we do need a fix. I need to revert the GraphQL change as |
||
| val, _ := v.(string) | ||
| return strings.ToLower(val) | ||
| }, | ||
| Description: "User to add to the team.", | ||
| }, | ||
| "role": { | ||
| Type: schema.TypeString, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.