Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmd/driver): fixed segfault in driver config command. #368

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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