Skip to content

Commit

Permalink
🐛 ensure converted directory is created. (#59)
Browse files Browse the repository at this point in the history
Not sure what changed in the shim (or rulesets) but using :latest, the
output directory is only created when rules are converted. Better
practice to not rely on the shim creating it.

Fixes:
```
errors:
    - severity: Error
      description: 'open /addon/rules/converted: no such file or directory'
    - severity: Error
      description: 'Pod failed: Error'
```

Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel authored Nov 3, 2023
1 parent 4c5aae4 commit 711b0f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ func (r *Rules) addSelector(options *command.Options) (err error) {
// convert windup rules.
func (r *Rules) convert() (err error) {
output := path.Join(RuleDir, "converted")
err = nas.MkDir(output, 0755)
if err != nil {
return
}
cmd := command.Command{Path: "/usr/bin/windup-shim"}
cmd.Options.Add("convert")
cmd.Options.Add("--outputdir", output)
Expand Down

0 comments on commit 711b0f4

Please sign in to comment.