Skip to content
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

Workaround API consistency bugs for various resources #659

Merged
merged 17 commits into from
Nov 12, 2021
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f495016
Switch to hashicorp/go-uuid in acceptance package
manicminer Nov 11, 2021
b61f197
Increase retry limit by one
manicminer Nov 11, 2021
349687d
Add WaitForDeletion helper func
manicminer Nov 11, 2021
8c7f2ff
Use WaitForDeletion helper in conditionalaccess package, move expand/…
manicminer Nov 11, 2021
a004a5b
azuread_user: check for consistency on deletion
manicminer Nov 11, 2021
034f460
azuread_invitation: check for consistency on creation by attmpting to…
manicminer Nov 11, 2021
f65be8a
azuread_group_member: check for consistency on deletion
manicminer Nov 11, 2021
520693d
azuread_group: check for consistency on creation by attempting to pat…
manicminer Nov 11, 2021
ce26230
azuread_directory_role_member: check for consistency on deletion
manicminer Nov 11, 2021
292f3c0
Helper funcs for retrieving a KeyCredential/PasswordCredential by its…
manicminer Nov 11, 2021
f1af244
azuread_application_certificate: check for consistency on deletion
manicminer Nov 11, 2021
ec6fd14
azuread_application_password: check for consistency on deletion
manicminer Nov 11, 2021
30aafee
azuread_application: check for consistency on creation by attempting …
manicminer Nov 11, 2021
d038d2e
azuread_service_principal_certificate: check for consistency on deletion
manicminer Nov 11, 2021
226facc
azuread_service_principal_password: check for consistency on deletion
manicminer Nov 11, 2021
a9abfd8
azuread_service_principal: check for consistency on creation by attem…
manicminer Nov 11, 2021
d0cbaf6
Fix azuread_service_principal test - https identifier_uris must use a…
manicminer Nov 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
azuread_directory_role_member: check for consistency on deletion
manicminer committed Nov 12, 2021

Verified

This commit was signed with the committer’s verified signature.
manicminer Tom Bamford
commit ce26230bb885d04b3cc270c2fde457b96a3e8949
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ import (
"github.com/manicminer/hamilton/odata"

"github.com/hashicorp/terraform-provider-azuread/internal/clients"
"github.com/hashicorp/terraform-provider-azuread/internal/helpers"
"github.com/hashicorp/terraform-provider-azuread/internal/services/directoryroles/parse"
"github.com/hashicorp/terraform-provider-azuread/internal/tf"
"github.com/hashicorp/terraform-provider-azuread/internal/utils"
@@ -174,5 +175,19 @@ func directoryRoleMemberResourceDelete(ctx context.Context, d *schema.ResourceDa
return tf.ErrorDiagF(err, "Removing member %q from directory role with object ID: %q", id.MemberId, id.DirectoryRoleId)
}

// Wait for membership link to be deleted
if err := helpers.WaitForDeletion(ctx, func(ctx context.Context) (*bool, error) {
client.BaseClient.DisableRetries = true
if _, status, err := client.GetMember(ctx, id.DirectoryRoleId, id.MemberId); err != nil {
if status == http.StatusNotFound {
return utils.Bool(false), nil
}
return nil, err
}
return utils.Bool(true), nil
}); err != nil {
return tf.ErrorDiagF(err, "Waiting for removal of member %q from directory role with object ID %q", id.MemberId, id.DirectoryRoleId)
}

return nil
}