Skip to content

Commit

Permalink
Fix a couple of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
eh-steve authored and Anonymous committed Jul 4, 2024
1 parent 0af30df commit 9da9799
Show file tree
Hide file tree
Showing 2 changed files with 6,041 additions and 171 deletions.
14 changes: 9 additions & 5 deletions plugin/iamutil/internal/generate_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ func main() {

func checkResource(name string, fullPath string, resource *discovery.RestResource, doc *discovery.RestDescription, docMeta *discovery.DirectoryListItems, config iamutil.GeneratedResources) error {
for rName, child := range resource.Resources {
return checkResource(rName, fullPath+"/"+rName, &child, doc, docMeta, config)
err := checkResource(rName, fullPath+"/"+rName, &child, doc, docMeta, config)
if err != nil {
return err
}
}

getM, hasGet := resource.Methods["getIamPolicy"]
setM, hasSet := resource.Methods["setIamPolicy"]

if !hasGet && !hasSet {
if !hasGet || !hasSet {
// Can't manage anything without both setIamPolicy and getIamPolicy
return nil
}

Expand Down Expand Up @@ -246,9 +250,6 @@ func generateConfig() error {
}
}
}
if mErr != nil {
return fmt.Errorf("errors while generating config: \n%s", mErr)
}

// Inject overrides that use ACLs instead of IAM policies
for k, v := range resourceOverrides {
Expand All @@ -259,6 +260,9 @@ func generateConfig() error {
return err
}

if mErr != nil {
return fmt.Errorf("errors while generating config: \n%s", mErr)
}
return nil
}

Expand Down
Loading

0 comments on commit 9da9799

Please sign in to comment.