Skip to content

Commit

Permalink
fix: split multi-manifest file with regex instead (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteogastaldello authored Jul 4, 2024
1 parent 6a75286 commit f427729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/tools/rbacgen/rbacgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ func (r *RbacGenerator) getResourcesInfo(templatesDir string) ([]Resource, error
out.WriteString(finded + "\n")
}

yamls := strings.Split(out.String(), "---")
dividerReg := regexp.MustCompile(`^-{3}$`)
yamls := dividerReg.Split(out.String(), -1)

for _, y := range yamls {
n, _ := yaml.Parse(y)
Expand Down

0 comments on commit f427729

Please sign in to comment.