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

Backport 1.5.1: set policy version appropriately after roleset bindings have changed (#93) #94

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions plugin/iamutil/api_handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func verifyIamResource_GetSetPolicy(t *testing.T, resourceType string,
Email: creds.ClientEmail,
})

if p.Version != newP.Version {
t.Fatalf("expected policy version %d after adding bindings, got %d", p.Version, newP.Version)
}

if err != nil {
t.Fatalf("could not get IAM Policy for resource type '%s': %v", resourceType, err)
}
Expand Down
1 change: 1 addition & 0 deletions plugin/iamutil/iam_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (p *Policy) ChangedBindings(toAdd *PolicyDelta, toRemove *PolicyDelta) (cha
return true, &Policy{
Bindings: newBindings,
Etag: p.Etag,
Version: p.Version,
}
}
return false, p
Expand Down