Skip to content

Commit

Permalink
add config file option to flare command for improved flexibility (#2107)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarfda authored Feb 19, 2025
1 parent 0900566 commit 4f23f65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/launcher/flare.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ func runFlare(systemMultiSlogger *multislogger.MultiSlogger, args []string) erro
flSave = flagset.String("save", "upload", "local | upload")
flOutputDir = flagset.String("output_dir", ".", "path to directory to save flare output")
flUploadRequestURL = flagset.String("upload_request_url", "https://api.kolide.com/api/agent/flare", "URL to request a signed upload URL")
flConfigFilePath = flagset.String("config", launcher.DefaultConfigFilePath, "config file to parse options from (optional)")
)

if err := ff.Parse(flagset, args); err != nil {
return fmt.Errorf("parsing flags: %w", err)
}

// were passing an empty array here just to get the default options
opts, err := launcher.ParseOptions("flareupload", make([]string, 0))
opts, err := launcher.ParseOptions("flare", []string{"-config", *flConfigFilePath})
if err != nil {
return err
}
Expand Down Expand Up @@ -104,6 +104,7 @@ func runFlare(systemMultiSlogger *multislogger.MultiSlogger, args []string) erro
"flare creation complete",
"status", successMessage,
"file", flareDest.Name(),
"config_path", *flConfigFilePath,
)

return nil
Expand Down

0 comments on commit 4f23f65

Please sign in to comment.