Skip to content

Commit

Permalink
fix up opts arg passing
Browse files Browse the repository at this point in the history
  • Loading branch information
zackattack01 committed Jun 7, 2024
1 parent aef0e99 commit c02eaf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/launcher/svc_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runWindowsSvc(systemSlogger *multislogger.MultiSlogger, args []string) erro
// Create a local logger. This logs to a known path, and aims to help diagnostics
if opts.RootDirectory != "" {
// check for old root directories before creating DB in case we've stomped over with windows MSI install
updatedRootDirectory := determineRootDirectory(opts.RootDirectory, systemSlogger.Logger)
updatedRootDirectory := determineRootDirectory(opts, systemSlogger.Logger)
if updatedRootDirectory != opts.RootDirectory {
systemSlogger.Log(context.TODO(), slog.LevelInfo,
"old root directory contents detected, overriding opts.RootDirectory",
Expand Down Expand Up @@ -252,7 +252,8 @@ func (w *winSvc) Execute(args []string, r <-chan svc.ChangeRequest, changes chan

// determineRootDirectory is used specifically for windows deployments to override the
// configured root directory if another one containing a launcher DB already exists
func determineRootDirectory(optsRootDirectory string, slogger *slog.Logger, opts *launcher.Options) string {
func determineRootDirectory(opts *launcher.Options, slogger *slog.Logger) string {
optsRootDirectory := opts.RootDirectory
// don't mess with the path if this installation isn't pointing to a kolide server URL
if opts.ControlServerURL != "k2device.kolide.com" && opts.ControlServerURL != "k2device-preprod.kolide.com" {
return optsRootDirectory
Expand Down

0 comments on commit c02eaf2

Please sign in to comment.