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

Refactored authoritative IAM policy logic to be reusable #776

Merged
merged 2 commits into from
Nov 21, 2017

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Nov 21, 2017

Similar to the work I did for IAM binding and member resources in #744.

Could not reuse it for project because of the deprecated authoritative boolean field. Once we bump the version and remove the deprecated field in project, we can reuse the same logic. I created an issue to track this work once the field is removed #777.

@rosbo rosbo requested a review from danawillow November 21, 2017 22:23
@rosbo
Copy link
Contributor Author

rosbo commented Nov 21, 2017

--- PASS: TestAccGoogleFolderIamPolicy_basic (16.82s)
--- PASS: TestAccGoogleFolderIamPolicy_update (20.12s)

}

func (u *FolderIamUpdater) GetMutexKey() string {
return fmt.Sprintf("iam-project-%s", u.folderId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/project/folder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}

func (u *FolderIamUpdater) DescribeResource() string {
return fmt.Sprintf("project %q", u.folderId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

out := &resourceManagerV2Beta1.Policy{}
err := Convert(in, out)
if err != nil {
return nil, fmt.Errorf("Cannot convert a v1 oolicy to a v2beta policy: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: s/oolicy/policy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

out := &cloudresourcemanager.Policy{}
err := Convert(in, out)
if err != nil {
return nil, fmt.Errorf("Cannot convert a v2beta oolicy to a v1 policy: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@rosbo rosbo merged commit ac0948e into hashicorp:master Nov 21, 2017
@rosbo rosbo deleted the iam-folder-policy-refactor branch November 21, 2017 22:58
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this pull request Sep 27, 2019
Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants