Skip to content

Commit

Permalink
fix(cmd): properly inherit --all flag.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Jan 31, 2024
1 parent 78e115c commit 2f5dda5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ limitations under the License.
package cmd

import (
"fmt"
"strings"
"time"

"github.com/falcosecurity/event-generator/events"
Expand Down Expand Up @@ -95,12 +97,18 @@ Without arguments it runs all actions, otherwise only those actions matching the

l := logger.StandardLogger()

// Honor --all too!
exeArgs := fmt.Sprintf("--loglevel %s run", l.GetLevel().String())
if all {
exeArgs += " --all"
}

runOpts := []runner.Option{
runner.WithLogger(l),
runner.WithKubeNamespace(ns),
runner.WithKubeFactory(cmdutil.NewFactory(matchVersionKubeConfigFlags)),
// todo(leogr): inherit other flags
runner.WithExecutable("", "--loglevel", l.GetLevel().String(), "run"),
runner.WithExecutable("", strings.Split(exeArgs, " ")...),
runner.WithSleep(sleep),
runner.WithLoop(loop),
runner.WithAllEnabled(all),
Expand Down

0 comments on commit 2f5dda5

Please sign in to comment.