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

Rename EnableWatchdog to WatchdogEnabled #1508

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cmd/launcher/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func commonRunnerOptions(logger log.Logger, k types.Knapsack) []runtime.OsqueryI
runtime.WithAutoloadedExtensions(k.AutoloadedExtensions()...),
runtime.WithUpdateDirectory(k.UpdateDirectory()),
runtime.WithUpdateChannel(k.UpdateChannel()),
runtime.WithEnableWatchdog(k.EnableWatchdog()),
runtime.WithEnableWatchdog(k.WatchdogEnabled()),
}
}

Expand Down
8 changes: 4 additions & 4 deletions ee/agent/flags/flag_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ func (fc *FlagController) OsqueryVerbose() bool {
return NewBoolFlagValue(WithDefaultBool(fc.cmdLineOpts.OsqueryVerbose)).get(fc.getControlServerValue(keys.OsqueryVerbose))
}

func (fc *FlagController) SetEnableWatchdog(enable bool) error {
return fc.setControlServerValue(keys.EnableWatchdog, boolToBytes(enable))
func (fc *FlagController) SetWatchdogEnabled(enable bool) error {
return fc.setControlServerValue(keys.WatchdogEnabled, boolToBytes(enable))
}
func (fc *FlagController) EnableWatchdog() bool {
return NewBoolFlagValue(WithDefaultBool(fc.cmdLineOpts.EnableWatchdog)).get(fc.getControlServerValue(keys.EnableWatchdog))
func (fc *FlagController) WatchdogEnabled() bool {
return NewBoolFlagValue(WithDefaultBool(fc.cmdLineOpts.WatchdogEnabled)).get(fc.getControlServerValue(keys.WatchdogEnabled))
}

func (fc *FlagController) SetWatchdogDelaySec(sec int) error {
Expand Down
2 changes: 1 addition & 1 deletion ee/agent/flags/keys/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
Debug FlagKey = "debug"
DebugLogFile FlagKey = "debug_log_file"
OsqueryVerbose FlagKey = "osquery_verbose"
EnableWatchdog FlagKey = "enable_watchdog"
WatchdogEnabled FlagKey = "watchdog_enabled"
WatchdogDelaySec FlagKey = "watchdog_delay_sec"
WatchdogMemoryLimitMB FlagKey = "watchdog_memory_limit_mb"
WatchdogUtilizationLimitPercent FlagKey = "watchdog_utilization_limit_percent"
Expand Down
8 changes: 4 additions & 4 deletions ee/agent/knapsack/knapsack.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ func (k *knapsack) OsqueryVerbose() bool {
return k.flags.OsqueryVerbose()
}

func (k *knapsack) SetEnableWatchdog(enable bool) error {
return k.flags.SetEnableWatchdog(enable)
func (k *knapsack) SetWatchdogEnabled(enable bool) error {
return k.flags.SetWatchdogEnabled(enable)
}
func (k *knapsack) EnableWatchdog() bool {
return k.flags.EnableWatchdog()
func (k *knapsack) WatchdogEnabled() bool {
return k.flags.WatchdogEnabled()
}

func (k *knapsack) SetWatchdogDelaySec(sec int) error {
Expand Down
6 changes: 3 additions & 3 deletions ee/agent/types/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ type Flags interface {
SetOsqueryVerbose(verbose bool) error
OsqueryVerbose() bool

// EnableWatchdog enables the osquery watchdog
SetEnableWatchdog(enable bool) error
EnableWatchdog() bool
// WatchdogEnabled enables the osquery watchdog
SetWatchdogEnabled(enable bool) error
WatchdogEnabled() bool

// WatchdogDelaySec sets the number of seconds the watchdog will delay on startup before running
SetWatchdogDelaySec(sec int) error
Expand Down
56 changes: 28 additions & 28 deletions ee/agent/types/mocks/flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions ee/agent/types/mocks/knapsack.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ type Options struct {
DebugLogFile string
// OsqueryVerbose puts osquery into verbose mode
OsqueryVerbose bool
// EnableWatchdog enables the osquery watchdog
EnableWatchdog bool
// WatchdogEnabled enables the osquery watchdog
WatchdogEnabled bool
// WatchdogDelaySec sets the number of seconds the watchdog will delay on startup before running
WatchdogDelaySec int
// WatchdogMemoryLimitMB sets the memory limit on osquery processes
Expand Down Expand Up @@ -221,7 +221,7 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
flLoggingInterval = flagset.Duration("logging_interval", 60*time.Second, "The interval at which logs should be flushed to the server")
flOsquerydPath = flagset.String("osqueryd_path", "", "Path to the osqueryd binary to use (Default: find osqueryd in $PATH)")
flOsqueryHealthcheckStartupDelay = flagset.Duration("osquery_healthcheck_startup_delay", 10*time.Minute, "time to wait before beginning osquery healthchecks")
flEnableWatchdog = flagset.Bool("enable_watchdog", false, "Whether to enable the osquery watchdog")
flWatchdogEnabled = flagset.Bool("watchdog_enabled", false, "Whether to enable the osquery watchdog")
flWatchdogDelaySec = flagset.Int("watchdog_delay_sec", 60, "How many seconds to delay running watchdog after osquery startup")
flWatchdogMemoryLimitMB = flagset.Int("watchdog_memory_limit_mb", 200, "osquery memory utilization limit in MB")
flWatchdogUtilizationLimitPercent = flagset.Int("watchdog_utilization_limit_percent", 10, "osquery CPU utilization limit in percent")
Expand Down Expand Up @@ -389,7 +389,7 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
DisableControlTLS: disableControlTLS,
InsecureControlTLS: insecureControlTLS,
EnableInitialRunner: *flInitialRunner,
EnableWatchdog: *flEnableWatchdog,
WatchdogEnabled: *flWatchdogEnabled,
EnrollSecret: *flEnrollSecret,
EnrollSecretPath: *flEnrollSecretPath,
ExportTraces: *flExportTraces,
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 @@ -264,7 +264,7 @@ func getArgsAndResponse() (map[string]string, *Options) {
UpdateChannel: "stable",
AutoloadedExtensions: []string{"some-extension.ext"},
DelayStart: 0 * time.Second,
EnableWatchdog: false,
WatchdogEnabled: false,
WatchdogDelaySec: 60,
WatchdogMemoryLimitMB: 200,
WatchdogUtilizationLimitPercent: 10,
Expand Down
Loading