Skip to content

Commit

Permalink
fix(cmd/driver): fixed segfault in driver config command.
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 Dec 6, 2023
1 parent 609a8a2 commit 1a013c6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions cmd/driver/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewDriverConfigCmd(ctx context.Context, opt *options.Common, driver *option
Short: "[Preview] Configure a driver",
Long: longConfig,
RunE: func(cmd *cobra.Command, args []string) error {
return o.RunDriverConfig(ctx, cmd)
return o.RunDriverConfig(ctx)
},
}

Expand All @@ -80,12 +80,7 @@ func NewDriverConfigCmd(ctx context.Context, opt *options.Common, driver *option
}

// RunDriverConfig implements the driver configuration command.
func (o *driverConfigOptions) RunDriverConfig(ctx context.Context, cmd *cobra.Command) error {
var (
dType drivertype.DriverType
err error
)

func (o *driverConfigOptions) RunDriverConfig(ctx context.Context) error {
o.Printer.Logger.Info("Running falcoctl driver config", o.Printer.Logger.Args(
"name", o.Driver.Name,
"version", o.Driver.Version,
Expand All @@ -94,8 +89,7 @@ func (o *driverConfigOptions) RunDriverConfig(ctx context.Context, cmd *cobra.Co
"repos", strings.Join(o.Driver.Repos, ",")))

if o.Update {
err = o.commit(ctx, dType)
if err != nil {
if err := o.commit(ctx, o.Driver.Type); err != nil {
return err
}
}
Expand Down

0 comments on commit 1a013c6

Please sign in to comment.