Skip to content

Commit

Permalink
use shared defaultLauncherIdentifier const
Browse files Browse the repository at this point in the history
  • Loading branch information
zackattack01 committed Aug 14, 2024
1 parent 2289b74 commit 6ea6353
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"github.com/peterbourgon/ff/v3"
)

const defaultLauncherIdentifier string = "kolide-k2"

// Options is the set of options that may be configured for Launcher.
type Options struct {
// KolideServerURL is the URL of the management server to connect to.
Expand Down Expand Up @@ -257,7 +259,7 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
flIAmBreakingEELicense = flagset.Bool("i-am-breaking-ee-license", false, "Skip license check before running localserver (default: false)")
flDelayStart = flagset.Duration("delay_start", 0*time.Second, "How much time to wait before starting launcher")
flLocalDevelopmentPath = flagset.String("localdev_path", "", "Path to local launcher build")
flPackageIdentifier = flagset.String("identifier", "kolide-k2", "packaging identifier used to determine service names, paths, etc. (default: kolide-k2)")
flPackageIdentifier = flagset.String("identifier", defaultLauncherIdentifier, "packaging identifier used to determine service names, paths, etc. (default: kolide-k2)")

// deprecated options, kept for any kind of config file compatibility
_ = flagset.String("debug_log_file", "", "DEPRECATED")
Expand Down
2 changes: 1 addition & 1 deletion pkg/launcher/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func getArgsAndResponse() (map[string]string, *Options) {
WatchdogDelaySec: 120,
WatchdogMemoryLimitMB: 600,
WatchdogUtilizationLimitPercent: 50,
Identifier: "kolide-k2",
Identifier: defaultLauncherIdentifier,
}

return args, opts
Expand Down
2 changes: 0 additions & 2 deletions pkg/launcher/pkg_utils_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (

var nonAlphanumericRegex = regexp.MustCompile(`[^a-zA-Z0-9]+`)

const defaultLauncherIdentifier string = "kolide-k2"

// ServiceName embeds the given identifier into our service name template after sanitization,
// and returns the camelCased service name generated to match our packaging logic
func ServiceName(identifier string) string {
Expand Down

0 comments on commit 6ea6353

Please sign in to comment.