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

Fix rollback error on roleset not being created properly. #4

Merged
merged 1 commit into from
Apr 12, 2018

Conversation

emilymye
Copy link
Contributor

No description provided.

@emilymye emilymye requested a review from jefferai April 12, 2018 20:28
rolesToRemove := util.ToSet(entry.Roles)
if rs.AccountId.ResourceName() == entry.AccountId.ResourceName() {
if rs != nil && rs.AccountId.ResourceName() == entry.AccountId.ResourceName() {
Copy link
Member

Choose a reason for hiding this comment

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

if rs is nil is there any point in continuing on with the rest of the function? Or can we check a bit higher up and bail out early?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's nil, we should actually clean up - this part checks that we don't accidently delete bindings for a roleset that still exist (i.e. someone deleted and re-added bindings but the WAL entry was not cleared yet).

Copy link
Member

Choose a reason for hiding this comment

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

Ah, gotcha. Looks good then!

@emilymye emilymye merged commit ada0fa6 into hashicorp:master Apr 12, 2018
@emilymye
Copy link
Contributor Author

#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants