From 711b0f48068f67f211c7e2357dec73d42db3d677 Mon Sep 17 00:00:00 2001 From: Jeff Ortel Date: Fri, 3 Nov 2023 14:16:54 -0500 Subject: [PATCH] :bug: ensure converted directory is created. (#59) 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 --- cmd/rules.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/rules.go b/cmd/rules.go index 2663292..1307ec9 100644 --- a/cmd/rules.go +++ b/cmd/rules.go @@ -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)