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

Fixes roleset bindings for BigQuery datasets #130

Merged
merged 7 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion plugin/iamutil/resource_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (apis GeneratedResources) Parse(rawName string) (Resource, error) {
return nil, err
}
switch cfg.TypeKey {
case "projects/dataset":
case "projects/datasets":
return &DatasetResource{relativeId: relName, config: cfg}, nil
default:
return &IamResource{relativeId: relName, config: cfg}, nil
Expand Down
14 changes: 9 additions & 5 deletions plugin/iamutil/resource_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ func TestEnabledIamResources_RelativeName(t *testing.T) {
}

if resource != nil {
if err = verifyResource(resourceType, resource.(*IamResource)); err != nil {
t.Errorf("could not verify resource for relative resource name %q: %sv", testRelName, err)
if r, ok := resource.(*IamResource); ok {
austingebauer marked this conversation as resolved.
Show resolved Hide resolved
if err = verifyResource(resourceType, r); err != nil {
t.Errorf("could not verify resource for relative resource name %q: %sv", testRelName, err)
}
}
}
} else if resource != nil || err == nil {
Expand All @@ -67,9 +69,11 @@ func TestEnabledIamResources_FullName(t *testing.T) {
t.Errorf("failed to get resource for full resource name %s (type: %s): %v", testFullName, resourceType, err)
continue
}
if err = verifyResource(resourceType, resource.(*IamResource)); err != nil {
t.Errorf("could not verify resource for relative resource name %s: %v", testFullName, err)
continue
if r, ok := resource.(*IamResource); ok {
if err = verifyResource(resourceType, r); err != nil {
t.Errorf("could not verify resource for relative resource name %s: %v", testFullName, err)
continue
}
}
} else if resource != nil || err == nil {
t.Errorf("expected error for using full resource name %s (type: %s), got resource:\n %v\n", testFullName, resourceType, resource)
Expand Down