diff --git a/ee/agent/flags/flag_controller.go b/ee/agent/flags/flag_controller.go index 23b659db1..f7d68b250 100644 --- a/ee/agent/flags/flag_controller.go +++ b/ee/agent/flags/flag_controller.go @@ -541,6 +541,16 @@ func (fc *FlagController) LauncherWatchdogEnabled() bool { ).get(fc.getControlServerValue(keys.LauncherWatchdogEnabled)) } +func (fc *FlagController) SetSystrayRestartEnabled(enabled bool) error { + return fc.setControlServerValue(keys.SystrayRestartEnabled, boolToBytes(enabled)) +} + +func (fc *FlagController) SystrayRestartEnabled() bool { + return NewBoolFlagValue( + WithDefaultBool(false), + ).get(fc.getControlServerValue(keys.SystrayRestartEnabled)) +} + func (fc *FlagController) SetTraceSamplingRate(rate float64) error { return fc.setControlServerValue(keys.TraceSamplingRate, float64ToBytes(rate)) } diff --git a/ee/agent/flags/keys/keys.go b/ee/agent/flags/keys/keys.go index 1af492ea9..cb2ff63f9 100644 --- a/ee/agent/flags/keys/keys.go +++ b/ee/agent/flags/keys/keys.go @@ -5,8 +5,8 @@ type FlagKey string // When adding a new FlagKey: // 1. Define the FlagKey identifier, and the string key value it corresponds to, in the block below -// 2. Add a getter and setter to the Flags interface (flags.go) -// 3. Implement the getter and setter in the FlagController, providing defaults, limits, and overrides +// 2. Add a getter and setter to the Flags interface (ee/agent/types/flags.go) +// 3. Implement the getter and setter in the FlagController (ee/agent/flags/flag_controller.go), providing defaults, limits, and overrides // 4. Implement tests for any new APIs, sanitizers, limits, overrides. // 5. Update mocks -- in ee/agent/types, run `mockery --name Knapsack` and `mockery --name Flags`. const ( @@ -56,6 +56,7 @@ const ( InModernStandby FlagKey = "in_modern_standby" LocalDevelopmentPath FlagKey = "localdev_path" LauncherWatchdogEnabled FlagKey = "launcher_watchdog_enabled" // note that this will only impact windows deployments for now + SystrayRestartEnabled FlagKey = "systray_restart_enabled" ) func (key FlagKey) String() string { diff --git a/ee/agent/types/flags.go b/ee/agent/types/flags.go index 94bfc23fa..3c6cda0b2 100644 --- a/ee/agent/types/flags.go +++ b/ee/agent/types/flags.go @@ -226,4 +226,8 @@ type Flags interface { // LauncherWatchdogEnabled controls whether launcher installs/runs, or stops/removes the launcher watchdog service SetLauncherWatchdogEnabled(enabled bool) error LauncherWatchdogEnabled() bool + + // SystrayRestartEnabled controls whether launcher's desktop runner will restart systray on error + SetSystrayRestartEnabled(enabled bool) error + SystrayRestartEnabled() bool } diff --git a/ee/agent/types/mocks/flags.go b/ee/agent/types/mocks/flags.go index 25be2d780..8dda3e646 100644 --- a/ee/agent/types/mocks/flags.go +++ b/ee/agent/types/mocks/flags.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.45.0. DO NOT EDIT. package mocks @@ -20,6 +20,10 @@ type Flags struct { func (_m *Flags) Autoupdate() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Autoupdate") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -34,6 +38,10 @@ func (_m *Flags) Autoupdate() bool { func (_m *Flags) AutoupdateInitialDelay() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AutoupdateInitialDelay") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -48,6 +56,10 @@ func (_m *Flags) AutoupdateInitialDelay() time.Duration { func (_m *Flags) AutoupdateInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AutoupdateInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -62,6 +74,10 @@ func (_m *Flags) AutoupdateInterval() time.Duration { func (_m *Flags) CertPins() [][]byte { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for CertPins") + } + var r0 [][]byte if rf, ok := ret.Get(0).(func() [][]byte); ok { r0 = rf() @@ -78,6 +94,10 @@ func (_m *Flags) CertPins() [][]byte { func (_m *Flags) ControlRequestInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ControlRequestInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -92,6 +112,10 @@ func (_m *Flags) ControlRequestInterval() time.Duration { func (_m *Flags) ControlServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ControlServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -106,6 +130,10 @@ func (_m *Flags) ControlServerURL() string { func (_m *Flags) Debug() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Debug") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -120,6 +148,10 @@ func (_m *Flags) Debug() bool { func (_m *Flags) DebugLogFile() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DebugLogFile") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -134,6 +166,10 @@ func (_m *Flags) DebugLogFile() string { func (_m *Flags) DebugServerData() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DebugServerData") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -148,6 +184,10 @@ func (_m *Flags) DebugServerData() bool { func (_m *Flags) DesktopEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -162,6 +202,10 @@ func (_m *Flags) DesktopEnabled() bool { func (_m *Flags) DesktopMenuRefreshInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopMenuRefreshInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -176,6 +220,10 @@ func (_m *Flags) DesktopMenuRefreshInterval() time.Duration { func (_m *Flags) DesktopUpdateInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopUpdateInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -190,6 +238,10 @@ func (_m *Flags) DesktopUpdateInterval() time.Duration { func (_m *Flags) DisableControlTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DisableControlTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -204,6 +256,10 @@ func (_m *Flags) DisableControlTLS() bool { func (_m *Flags) DisableTraceIngestTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DisableTraceIngestTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -218,6 +274,10 @@ func (_m *Flags) DisableTraceIngestTLS() bool { func (_m *Flags) EnableInitialRunner() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnableInitialRunner") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -232,6 +292,10 @@ func (_m *Flags) EnableInitialRunner() bool { func (_m *Flags) EnrollSecret() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnrollSecret") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -246,6 +310,10 @@ func (_m *Flags) EnrollSecret() string { func (_m *Flags) EnrollSecretPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnrollSecretPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -260,6 +328,10 @@ func (_m *Flags) EnrollSecretPath() string { func (_m *Flags) ExportTraces() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ExportTraces") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -274,6 +346,10 @@ func (_m *Flags) ExportTraces() bool { func (_m *Flags) ForceControlSubsystems() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ForceControlSubsystems") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -288,6 +364,10 @@ func (_m *Flags) ForceControlSubsystems() bool { func (_m *Flags) IAmBreakingEELicense() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IAmBreakingEELicense") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -302,6 +382,10 @@ func (_m *Flags) IAmBreakingEELicense() bool { func (_m *Flags) InModernStandby() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InModernStandby") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -316,6 +400,10 @@ func (_m *Flags) InModernStandby() bool { func (_m *Flags) InsecureControlTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureControlTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -330,6 +418,10 @@ func (_m *Flags) InsecureControlTLS() bool { func (_m *Flags) InsecureTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -344,6 +436,10 @@ func (_m *Flags) InsecureTLS() bool { func (_m *Flags) InsecureTransportTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureTransportTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -358,6 +454,10 @@ func (_m *Flags) InsecureTransportTLS() bool { func (_m *Flags) KolideHosted() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for KolideHosted") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -372,6 +472,10 @@ func (_m *Flags) KolideHosted() bool { func (_m *Flags) KolideServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for KolideServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -386,6 +490,10 @@ func (_m *Flags) KolideServerURL() string { func (_m *Flags) LauncherWatchdogEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LauncherWatchdogEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -400,6 +508,10 @@ func (_m *Flags) LauncherWatchdogEnabled() bool { func (_m *Flags) LocalDevelopmentPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LocalDevelopmentPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -414,6 +526,10 @@ func (_m *Flags) LocalDevelopmentPath() string { func (_m *Flags) LogIngestServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogIngestServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -428,6 +544,10 @@ func (_m *Flags) LogIngestServerURL() string { func (_m *Flags) LogMaxBytesPerBatch() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogMaxBytesPerBatch") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -442,6 +562,10 @@ func (_m *Flags) LogMaxBytesPerBatch() int { func (_m *Flags) LogShippingLevel() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogShippingLevel") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -456,6 +580,10 @@ func (_m *Flags) LogShippingLevel() string { func (_m *Flags) LoggingInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LoggingInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -470,6 +598,10 @@ func (_m *Flags) LoggingInterval() time.Duration { func (_m *Flags) MirrorServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MirrorServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -484,6 +616,10 @@ func (_m *Flags) MirrorServerURL() string { func (_m *Flags) OsqueryFlags() []string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryFlags") + } + var r0 []string if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() @@ -500,6 +636,10 @@ func (_m *Flags) OsqueryFlags() []string { func (_m *Flags) OsqueryHealthcheckStartupDelay() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryHealthcheckStartupDelay") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -514,6 +654,10 @@ func (_m *Flags) OsqueryHealthcheckStartupDelay() time.Duration { func (_m *Flags) OsqueryTlsConfigEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsConfigEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -528,6 +672,10 @@ func (_m *Flags) OsqueryTlsConfigEndpoint() string { func (_m *Flags) OsqueryTlsDistributedReadEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsDistributedReadEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -542,6 +690,10 @@ func (_m *Flags) OsqueryTlsDistributedReadEndpoint() string { func (_m *Flags) OsqueryTlsDistributedWriteEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsDistributedWriteEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -556,6 +708,10 @@ func (_m *Flags) OsqueryTlsDistributedWriteEndpoint() string { func (_m *Flags) OsqueryTlsEnrollEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsEnrollEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -570,6 +726,10 @@ func (_m *Flags) OsqueryTlsEnrollEndpoint() string { func (_m *Flags) OsqueryTlsLoggerEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsLoggerEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -584,6 +744,10 @@ func (_m *Flags) OsqueryTlsLoggerEndpoint() string { func (_m *Flags) OsqueryVerbose() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryVerbose") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -598,6 +762,10 @@ func (_m *Flags) OsqueryVerbose() bool { func (_m *Flags) OsquerydPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsquerydPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -612,6 +780,10 @@ func (_m *Flags) OsquerydPath() string { func (_m *Flags) PinnedLauncherVersion() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for PinnedLauncherVersion") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -626,6 +798,10 @@ func (_m *Flags) PinnedLauncherVersion() string { func (_m *Flags) PinnedOsquerydVersion() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for PinnedOsquerydVersion") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -652,6 +828,10 @@ func (_m *Flags) RegisterChangeObserver(observer types.FlagsChangeObserver, flag func (_m *Flags) RootDirectory() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for RootDirectory") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -666,6 +846,10 @@ func (_m *Flags) RootDirectory() string { func (_m *Flags) RootPEM() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for RootPEM") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -680,6 +864,10 @@ func (_m *Flags) RootPEM() string { func (_m *Flags) SetAutoupdate(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdate") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -694,6 +882,10 @@ func (_m *Flags) SetAutoupdate(enabled bool) error { func (_m *Flags) SetAutoupdateInitialDelay(delay time.Duration) error { ret := _m.Called(delay) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdateInitialDelay") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(delay) @@ -708,6 +900,10 @@ func (_m *Flags) SetAutoupdateInitialDelay(delay time.Duration) error { func (_m *Flags) SetAutoupdateInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdateInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -722,6 +918,10 @@ func (_m *Flags) SetAutoupdateInterval(interval time.Duration) error { func (_m *Flags) SetControlRequestInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetControlRequestInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -741,6 +941,10 @@ func (_m *Flags) SetControlRequestIntervalOverride(value time.Duration, duration func (_m *Flags) SetControlServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetControlServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -755,6 +959,10 @@ func (_m *Flags) SetControlServerURL(url string) error { func (_m *Flags) SetDebug(debug bool) error { ret := _m.Called(debug) + if len(ret) == 0 { + panic("no return value specified for SetDebug") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(debug) @@ -769,6 +977,10 @@ func (_m *Flags) SetDebug(debug bool) error { func (_m *Flags) SetDebugServerData(debug bool) error { ret := _m.Called(debug) + if len(ret) == 0 { + panic("no return value specified for SetDebugServerData") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(debug) @@ -783,6 +995,10 @@ func (_m *Flags) SetDebugServerData(debug bool) error { func (_m *Flags) SetDesktopEnabled(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetDesktopEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -797,6 +1013,10 @@ func (_m *Flags) SetDesktopEnabled(enabled bool) error { func (_m *Flags) SetDesktopMenuRefreshInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetDesktopMenuRefreshInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -811,6 +1031,10 @@ func (_m *Flags) SetDesktopMenuRefreshInterval(interval time.Duration) error { func (_m *Flags) SetDesktopUpdateInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetDesktopUpdateInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -825,6 +1049,10 @@ func (_m *Flags) SetDesktopUpdateInterval(interval time.Duration) error { func (_m *Flags) SetDisableControlTLS(disabled bool) error { ret := _m.Called(disabled) + if len(ret) == 0 { + panic("no return value specified for SetDisableControlTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(disabled) @@ -839,6 +1067,10 @@ func (_m *Flags) SetDisableControlTLS(disabled bool) error { func (_m *Flags) SetDisableTraceIngestTLS(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetDisableTraceIngestTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -853,6 +1085,10 @@ func (_m *Flags) SetDisableTraceIngestTLS(enabled bool) error { func (_m *Flags) SetExportTraces(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetExportTraces") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -872,6 +1108,10 @@ func (_m *Flags) SetExportTracesOverride(value bool, duration time.Duration) { func (_m *Flags) SetForceControlSubsystems(force bool) error { ret := _m.Called(force) + if len(ret) == 0 { + panic("no return value specified for SetForceControlSubsystems") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(force) @@ -886,6 +1126,10 @@ func (_m *Flags) SetForceControlSubsystems(force bool) error { func (_m *Flags) SetInModernStandby(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetInModernStandby") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -900,6 +1144,10 @@ func (_m *Flags) SetInModernStandby(enabled bool) error { func (_m *Flags) SetInsecureControlTLS(disabled bool) error { ret := _m.Called(disabled) + if len(ret) == 0 { + panic("no return value specified for SetInsecureControlTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(disabled) @@ -914,6 +1162,10 @@ func (_m *Flags) SetInsecureControlTLS(disabled bool) error { func (_m *Flags) SetInsecureTLS(insecure bool) error { ret := _m.Called(insecure) + if len(ret) == 0 { + panic("no return value specified for SetInsecureTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(insecure) @@ -928,6 +1180,10 @@ func (_m *Flags) SetInsecureTLS(insecure bool) error { func (_m *Flags) SetInsecureTransportTLS(insecure bool) error { ret := _m.Called(insecure) + if len(ret) == 0 { + panic("no return value specified for SetInsecureTransportTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(insecure) @@ -942,6 +1198,10 @@ func (_m *Flags) SetInsecureTransportTLS(insecure bool) error { func (_m *Flags) SetKolideServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetKolideServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -956,6 +1216,10 @@ func (_m *Flags) SetKolideServerURL(url string) error { func (_m *Flags) SetLauncherWatchdogEnabled(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetLauncherWatchdogEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -970,6 +1234,10 @@ func (_m *Flags) SetLauncherWatchdogEnabled(enabled bool) error { func (_m *Flags) SetLogIngestServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetLogIngestServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -984,6 +1252,10 @@ func (_m *Flags) SetLogIngestServerURL(url string) error { func (_m *Flags) SetLogShippingLevel(level string) error { ret := _m.Called(level) + if len(ret) == 0 { + panic("no return value specified for SetLogShippingLevel") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(level) @@ -1003,6 +1275,10 @@ func (_m *Flags) SetLogShippingLevelOverride(value string, duration time.Duratio func (_m *Flags) SetLoggingInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetLoggingInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -1017,6 +1293,10 @@ func (_m *Flags) SetLoggingInterval(interval time.Duration) error { func (_m *Flags) SetMirrorServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetMirrorServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1031,6 +1311,10 @@ func (_m *Flags) SetMirrorServerURL(url string) error { func (_m *Flags) SetOsqueryHealthcheckStartupDelay(delay time.Duration) error { ret := _m.Called(delay) + if len(ret) == 0 { + panic("no return value specified for SetOsqueryHealthcheckStartupDelay") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(delay) @@ -1045,6 +1329,10 @@ func (_m *Flags) SetOsqueryHealthcheckStartupDelay(delay time.Duration) error { func (_m *Flags) SetOsqueryVerbose(verbose bool) error { ret := _m.Called(verbose) + if len(ret) == 0 { + panic("no return value specified for SetOsqueryVerbose") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(verbose) @@ -1059,6 +1347,10 @@ func (_m *Flags) SetOsqueryVerbose(verbose bool) error { func (_m *Flags) SetPinnedLauncherVersion(version string) error { ret := _m.Called(version) + if len(ret) == 0 { + panic("no return value specified for SetPinnedLauncherVersion") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(version) @@ -1073,6 +1365,10 @@ func (_m *Flags) SetPinnedLauncherVersion(version string) error { func (_m *Flags) SetPinnedOsquerydVersion(version string) error { ret := _m.Called(version) + if len(ret) == 0 { + panic("no return value specified for SetPinnedOsquerydVersion") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(version) @@ -1083,10 +1379,32 @@ func (_m *Flags) SetPinnedOsquerydVersion(version string) error { return r0 } +// SetSystrayRestartEnabled provides a mock function with given fields: enabled +func (_m *Flags) SetSystrayRestartEnabled(enabled bool) error { + ret := _m.Called(enabled) + + if len(ret) == 0 { + panic("no return value specified for SetSystrayRestartEnabled") + } + + var r0 error + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(enabled) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // SetTraceBatchTimeout provides a mock function with given fields: duration func (_m *Flags) SetTraceBatchTimeout(duration time.Duration) error { ret := _m.Called(duration) + if len(ret) == 0 { + panic("no return value specified for SetTraceBatchTimeout") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(duration) @@ -1101,6 +1419,10 @@ func (_m *Flags) SetTraceBatchTimeout(duration time.Duration) error { func (_m *Flags) SetTraceIngestServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetTraceIngestServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1115,6 +1437,10 @@ func (_m *Flags) SetTraceIngestServerURL(url string) error { func (_m *Flags) SetTraceSamplingRate(rate float64) error { ret := _m.Called(rate) + if len(ret) == 0 { + panic("no return value specified for SetTraceSamplingRate") + } + var r0 error if rf, ok := ret.Get(0).(func(float64) error); ok { r0 = rf(rate) @@ -1134,6 +1460,10 @@ func (_m *Flags) SetTraceSamplingRateOverride(value float64, duration time.Durat func (_m *Flags) SetTufServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetTufServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1148,6 +1478,10 @@ func (_m *Flags) SetTufServerURL(url string) error { func (_m *Flags) SetUpdateChannel(channel string) error { ret := _m.Called(channel) + if len(ret) == 0 { + panic("no return value specified for SetUpdateChannel") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(channel) @@ -1162,6 +1496,10 @@ func (_m *Flags) SetUpdateChannel(channel string) error { func (_m *Flags) SetUpdateDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for SetUpdateDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -1176,6 +1514,10 @@ func (_m *Flags) SetUpdateDirectory(directory string) error { func (_m *Flags) SetWatchdogDelaySec(sec int) error { ret := _m.Called(sec) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogDelaySec") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(sec) @@ -1190,6 +1532,10 @@ func (_m *Flags) SetWatchdogDelaySec(sec int) error { func (_m *Flags) SetWatchdogEnabled(enable bool) error { ret := _m.Called(enable) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enable) @@ -1204,6 +1550,10 @@ func (_m *Flags) SetWatchdogEnabled(enable bool) error { func (_m *Flags) SetWatchdogMemoryLimitMB(limit int) error { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogMemoryLimitMB") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(limit) @@ -1218,6 +1568,10 @@ func (_m *Flags) SetWatchdogMemoryLimitMB(limit int) error { func (_m *Flags) SetWatchdogUtilizationLimitPercent(limit int) error { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogUtilizationLimitPercent") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(limit) @@ -1228,10 +1582,32 @@ func (_m *Flags) SetWatchdogUtilizationLimitPercent(limit int) error { return r0 } +// SystrayRestartEnabled provides a mock function with given fields: +func (_m *Flags) SystrayRestartEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SystrayRestartEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // TraceBatchTimeout provides a mock function with given fields: func (_m *Flags) TraceBatchTimeout() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceBatchTimeout") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -1246,6 +1622,10 @@ func (_m *Flags) TraceBatchTimeout() time.Duration { func (_m *Flags) TraceIngestServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceIngestServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1260,6 +1640,10 @@ func (_m *Flags) TraceIngestServerURL() string { func (_m *Flags) TraceSamplingRate() float64 { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceSamplingRate") + } + var r0 float64 if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() @@ -1274,6 +1658,10 @@ func (_m *Flags) TraceSamplingRate() float64 { func (_m *Flags) Transport() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Transport") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1288,6 +1676,10 @@ func (_m *Flags) Transport() string { func (_m *Flags) TufServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TufServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1302,6 +1694,10 @@ func (_m *Flags) TufServerURL() string { func (_m *Flags) UpdateChannel() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for UpdateChannel") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1316,6 +1712,10 @@ func (_m *Flags) UpdateChannel() string { func (_m *Flags) UpdateDirectory() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for UpdateDirectory") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1330,6 +1730,10 @@ func (_m *Flags) UpdateDirectory() string { func (_m *Flags) WatchdogDelaySec() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogDelaySec") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -1344,6 +1748,10 @@ func (_m *Flags) WatchdogDelaySec() int { func (_m *Flags) WatchdogEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -1358,6 +1766,10 @@ func (_m *Flags) WatchdogEnabled() bool { func (_m *Flags) WatchdogMemoryLimitMB() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogMemoryLimitMB") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -1372,6 +1784,10 @@ func (_m *Flags) WatchdogMemoryLimitMB() int { func (_m *Flags) WatchdogUtilizationLimitPercent() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogUtilizationLimitPercent") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() diff --git a/ee/agent/types/mocks/knapsack.go b/ee/agent/types/mocks/knapsack.go index 5fddb59a9..339866056 100644 --- a/ee/agent/types/mocks/knapsack.go +++ b/ee/agent/types/mocks/knapsack.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.21.1. DO NOT EDIT. +// Code generated by mockery v2.45.0. DO NOT EDIT. package mocks @@ -40,6 +40,10 @@ func (_m *Knapsack) AddSlogHandler(handler ...slog.Handler) { func (_m *Knapsack) AgentFlagsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AgentFlagsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -56,6 +60,10 @@ func (_m *Knapsack) AgentFlagsStore() types.GetterSetterDeleterIteratorUpdaterCo func (_m *Knapsack) Autoupdate() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Autoupdate") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -70,6 +78,10 @@ func (_m *Knapsack) Autoupdate() bool { func (_m *Knapsack) AutoupdateErrorsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AutoupdateErrorsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -86,6 +98,10 @@ func (_m *Knapsack) AutoupdateErrorsStore() types.GetterSetterDeleterIteratorUpd func (_m *Knapsack) AutoupdateInitialDelay() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AutoupdateInitialDelay") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -100,6 +116,10 @@ func (_m *Knapsack) AutoupdateInitialDelay() time.Duration { func (_m *Knapsack) AutoupdateInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AutoupdateInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -114,6 +134,10 @@ func (_m *Knapsack) AutoupdateInterval() time.Duration { func (_m *Knapsack) BboltDB() *bbolt.DB { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for BboltDB") + } + var r0 *bbolt.DB if rf, ok := ret.Get(0).(func() *bbolt.DB); ok { r0 = rf() @@ -130,6 +154,10 @@ func (_m *Knapsack) BboltDB() *bbolt.DB { func (_m *Knapsack) CertPins() [][]byte { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for CertPins") + } + var r0 [][]byte if rf, ok := ret.Get(0).(func() [][]byte); ok { r0 = rf() @@ -146,6 +174,10 @@ func (_m *Knapsack) CertPins() [][]byte { func (_m *Knapsack) ConfigStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ConfigStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -162,6 +194,10 @@ func (_m *Knapsack) ConfigStore() types.GetterSetterDeleterIteratorUpdaterCounte func (_m *Knapsack) ControlRequestInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ControlRequestInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -176,6 +212,10 @@ func (_m *Knapsack) ControlRequestInterval() time.Duration { func (_m *Knapsack) ControlServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ControlServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -190,6 +230,10 @@ func (_m *Knapsack) ControlServerURL() string { func (_m *Knapsack) ControlStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ControlStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -206,6 +250,10 @@ func (_m *Knapsack) ControlStore() types.GetterSetterDeleterIteratorUpdaterCount func (_m *Knapsack) CurrentEnrollmentStatus() (types.EnrollmentStatus, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for CurrentEnrollmentStatus") + } + var r0 types.EnrollmentStatus var r1 error if rf, ok := ret.Get(0).(func() (types.EnrollmentStatus, error)); ok { @@ -230,6 +278,10 @@ func (_m *Knapsack) CurrentEnrollmentStatus() (types.EnrollmentStatus, error) { func (_m *Knapsack) Debug() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Debug") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -244,6 +296,10 @@ func (_m *Knapsack) Debug() bool { func (_m *Knapsack) DebugLogFile() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DebugLogFile") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -258,6 +314,10 @@ func (_m *Knapsack) DebugLogFile() string { func (_m *Knapsack) DebugServerData() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DebugServerData") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -272,6 +332,10 @@ func (_m *Knapsack) DebugServerData() bool { func (_m *Knapsack) DesktopEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -286,6 +350,10 @@ func (_m *Knapsack) DesktopEnabled() bool { func (_m *Knapsack) DesktopMenuRefreshInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopMenuRefreshInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -300,6 +368,10 @@ func (_m *Knapsack) DesktopMenuRefreshInterval() time.Duration { func (_m *Knapsack) DesktopUpdateInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DesktopUpdateInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -314,6 +386,10 @@ func (_m *Knapsack) DesktopUpdateInterval() time.Duration { func (_m *Knapsack) DisableControlTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DisableControlTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -328,6 +404,10 @@ func (_m *Knapsack) DisableControlTLS() bool { func (_m *Knapsack) DisableTraceIngestTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DisableTraceIngestTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -342,6 +422,10 @@ func (_m *Knapsack) DisableTraceIngestTLS() bool { func (_m *Knapsack) EnableInitialRunner() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnableInitialRunner") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -356,6 +440,10 @@ func (_m *Knapsack) EnableInitialRunner() bool { func (_m *Knapsack) EnrollSecret() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnrollSecret") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -370,6 +458,10 @@ func (_m *Knapsack) EnrollSecret() string { func (_m *Knapsack) EnrollSecretPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EnrollSecretPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -384,6 +476,10 @@ func (_m *Knapsack) EnrollSecretPath() string { func (_m *Knapsack) ExportTraces() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ExportTraces") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -398,6 +494,10 @@ func (_m *Knapsack) ExportTraces() bool { func (_m *Knapsack) ForceControlSubsystems() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ForceControlSubsystems") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -412,6 +512,10 @@ func (_m *Knapsack) ForceControlSubsystems() bool { func (_m *Knapsack) IAmBreakingEELicense() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IAmBreakingEELicense") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -426,6 +530,10 @@ func (_m *Knapsack) IAmBreakingEELicense() bool { func (_m *Knapsack) InModernStandby() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InModernStandby") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -440,6 +548,10 @@ func (_m *Knapsack) InModernStandby() bool { func (_m *Knapsack) InitialResultsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InitialResultsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -456,6 +568,10 @@ func (_m *Knapsack) InitialResultsStore() types.GetterSetterDeleterIteratorUpdat func (_m *Knapsack) InsecureControlTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureControlTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -470,6 +586,10 @@ func (_m *Knapsack) InsecureControlTLS() bool { func (_m *Knapsack) InsecureTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -484,6 +604,10 @@ func (_m *Knapsack) InsecureTLS() bool { func (_m *Knapsack) InsecureTransportTLS() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InsecureTransportTLS") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -498,6 +622,10 @@ func (_m *Knapsack) InsecureTransportTLS() bool { func (_m *Knapsack) KatcConfigStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for KatcConfigStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -514,6 +642,10 @@ func (_m *Knapsack) KatcConfigStore() types.GetterSetterDeleterIteratorUpdaterCo func (_m *Knapsack) KolideHosted() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for KolideHosted") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -528,6 +660,10 @@ func (_m *Knapsack) KolideHosted() bool { func (_m *Knapsack) KolideServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for KolideServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -542,6 +678,10 @@ func (_m *Knapsack) KolideServerURL() string { func (_m *Knapsack) LatestOsquerydPath(ctx context.Context) string { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for LatestOsquerydPath") + } + var r0 string if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(ctx) @@ -556,6 +696,10 @@ func (_m *Knapsack) LatestOsquerydPath(ctx context.Context) string { func (_m *Knapsack) LauncherWatchdogEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LauncherWatchdogEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -570,6 +714,10 @@ func (_m *Knapsack) LauncherWatchdogEnabled() bool { func (_m *Knapsack) LocalDevelopmentPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LocalDevelopmentPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -584,6 +732,10 @@ func (_m *Knapsack) LocalDevelopmentPath() string { func (_m *Knapsack) LogIngestServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogIngestServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -598,6 +750,10 @@ func (_m *Knapsack) LogIngestServerURL() string { func (_m *Knapsack) LogMaxBytesPerBatch() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogMaxBytesPerBatch") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -612,6 +768,10 @@ func (_m *Knapsack) LogMaxBytesPerBatch() int { func (_m *Knapsack) LogShippingLevel() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LogShippingLevel") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -626,6 +786,10 @@ func (_m *Knapsack) LogShippingLevel() string { func (_m *Knapsack) LoggingInterval() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LoggingInterval") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -640,6 +804,10 @@ func (_m *Knapsack) LoggingInterval() time.Duration { func (_m *Knapsack) MirrorServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MirrorServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -654,6 +822,10 @@ func (_m *Knapsack) MirrorServerURL() string { func (_m *Knapsack) OsqueryFlags() []string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryFlags") + } + var r0 []string if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() @@ -670,6 +842,10 @@ func (_m *Knapsack) OsqueryFlags() []string { func (_m *Knapsack) OsqueryHealthcheckStartupDelay() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryHealthcheckStartupDelay") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -684,6 +860,10 @@ func (_m *Knapsack) OsqueryHealthcheckStartupDelay() time.Duration { func (_m *Knapsack) OsqueryHistoryInstanceStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryHistoryInstanceStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -700,6 +880,10 @@ func (_m *Knapsack) OsqueryHistoryInstanceStore() types.GetterSetterDeleterItera func (_m *Knapsack) OsqueryTlsConfigEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsConfigEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -714,6 +898,10 @@ func (_m *Knapsack) OsqueryTlsConfigEndpoint() string { func (_m *Knapsack) OsqueryTlsDistributedReadEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsDistributedReadEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -728,6 +916,10 @@ func (_m *Knapsack) OsqueryTlsDistributedReadEndpoint() string { func (_m *Knapsack) OsqueryTlsDistributedWriteEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsDistributedWriteEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -742,6 +934,10 @@ func (_m *Knapsack) OsqueryTlsDistributedWriteEndpoint() string { func (_m *Knapsack) OsqueryTlsEnrollEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsEnrollEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -756,6 +952,10 @@ func (_m *Knapsack) OsqueryTlsEnrollEndpoint() string { func (_m *Knapsack) OsqueryTlsLoggerEndpoint() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryTlsLoggerEndpoint") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -770,6 +970,10 @@ func (_m *Knapsack) OsqueryTlsLoggerEndpoint() string { func (_m *Knapsack) OsqueryVerbose() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsqueryVerbose") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -784,6 +988,10 @@ func (_m *Knapsack) OsqueryVerbose() bool { func (_m *Knapsack) OsquerydPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OsquerydPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -798,6 +1006,10 @@ func (_m *Knapsack) OsquerydPath() string { func (_m *Knapsack) PersistentHostDataStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for PersistentHostDataStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -814,6 +1026,10 @@ func (_m *Knapsack) PersistentHostDataStore() types.GetterSetterDeleterIteratorU func (_m *Knapsack) PinnedLauncherVersion() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for PinnedLauncherVersion") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -828,6 +1044,10 @@ func (_m *Knapsack) PinnedLauncherVersion() string { func (_m *Knapsack) PinnedOsquerydVersion() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for PinnedOsquerydVersion") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -842,6 +1062,10 @@ func (_m *Knapsack) PinnedOsquerydVersion() string { func (_m *Knapsack) ReadEnrollSecret() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ReadEnrollSecret") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -878,6 +1102,10 @@ func (_m *Knapsack) RegisterChangeObserver(observer types.FlagsChangeObserver, f func (_m *Knapsack) ResultLogsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ResultLogsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -894,6 +1122,10 @@ func (_m *Knapsack) ResultLogsStore() types.GetterSetterDeleterIteratorUpdaterCo func (_m *Knapsack) RootDirectory() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for RootDirectory") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -908,6 +1140,10 @@ func (_m *Knapsack) RootDirectory() string { func (_m *Knapsack) RootPEM() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for RootPEM") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -922,6 +1158,10 @@ func (_m *Knapsack) RootPEM() string { func (_m *Knapsack) SentNotificationsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SentNotificationsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -938,6 +1178,10 @@ func (_m *Knapsack) SentNotificationsStore() types.GetterSetterDeleterIteratorUp func (_m *Knapsack) ServerProvidedDataStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ServerProvidedDataStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -954,6 +1198,10 @@ func (_m *Knapsack) ServerProvidedDataStore() types.GetterSetterDeleterIteratorU func (_m *Knapsack) SetAutoupdate(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdate") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -968,6 +1216,10 @@ func (_m *Knapsack) SetAutoupdate(enabled bool) error { func (_m *Knapsack) SetAutoupdateInitialDelay(delay time.Duration) error { ret := _m.Called(delay) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdateInitialDelay") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(delay) @@ -982,6 +1234,10 @@ func (_m *Knapsack) SetAutoupdateInitialDelay(delay time.Duration) error { func (_m *Knapsack) SetAutoupdateInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetAutoupdateInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -996,6 +1252,10 @@ func (_m *Knapsack) SetAutoupdateInterval(interval time.Duration) error { func (_m *Knapsack) SetControlRequestInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetControlRequestInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -1015,6 +1275,10 @@ func (_m *Knapsack) SetControlRequestIntervalOverride(value time.Duration, durat func (_m *Knapsack) SetControlServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetControlServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1029,6 +1293,10 @@ func (_m *Knapsack) SetControlServerURL(url string) error { func (_m *Knapsack) SetDebug(debug bool) error { ret := _m.Called(debug) + if len(ret) == 0 { + panic("no return value specified for SetDebug") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(debug) @@ -1043,6 +1311,10 @@ func (_m *Knapsack) SetDebug(debug bool) error { func (_m *Knapsack) SetDebugServerData(debug bool) error { ret := _m.Called(debug) + if len(ret) == 0 { + panic("no return value specified for SetDebugServerData") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(debug) @@ -1057,6 +1329,10 @@ func (_m *Knapsack) SetDebugServerData(debug bool) error { func (_m *Knapsack) SetDesktopEnabled(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetDesktopEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -1071,6 +1347,10 @@ func (_m *Knapsack) SetDesktopEnabled(enabled bool) error { func (_m *Knapsack) SetDesktopMenuRefreshInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetDesktopMenuRefreshInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -1085,6 +1365,10 @@ func (_m *Knapsack) SetDesktopMenuRefreshInterval(interval time.Duration) error func (_m *Knapsack) SetDesktopUpdateInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetDesktopUpdateInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -1099,6 +1383,10 @@ func (_m *Knapsack) SetDesktopUpdateInterval(interval time.Duration) error { func (_m *Knapsack) SetDisableControlTLS(disabled bool) error { ret := _m.Called(disabled) + if len(ret) == 0 { + panic("no return value specified for SetDisableControlTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(disabled) @@ -1113,6 +1401,10 @@ func (_m *Knapsack) SetDisableControlTLS(disabled bool) error { func (_m *Knapsack) SetDisableTraceIngestTLS(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetDisableTraceIngestTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -1127,6 +1419,10 @@ func (_m *Knapsack) SetDisableTraceIngestTLS(enabled bool) error { func (_m *Knapsack) SetExportTraces(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetExportTraces") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -1146,6 +1442,10 @@ func (_m *Knapsack) SetExportTracesOverride(value bool, duration time.Duration) func (_m *Knapsack) SetForceControlSubsystems(force bool) error { ret := _m.Called(force) + if len(ret) == 0 { + panic("no return value specified for SetForceControlSubsystems") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(force) @@ -1160,6 +1460,10 @@ func (_m *Knapsack) SetForceControlSubsystems(force bool) error { func (_m *Knapsack) SetInModernStandby(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetInModernStandby") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -1174,6 +1478,10 @@ func (_m *Knapsack) SetInModernStandby(enabled bool) error { func (_m *Knapsack) SetInsecureControlTLS(disabled bool) error { ret := _m.Called(disabled) + if len(ret) == 0 { + panic("no return value specified for SetInsecureControlTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(disabled) @@ -1188,6 +1496,10 @@ func (_m *Knapsack) SetInsecureControlTLS(disabled bool) error { func (_m *Knapsack) SetInsecureTLS(insecure bool) error { ret := _m.Called(insecure) + if len(ret) == 0 { + panic("no return value specified for SetInsecureTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(insecure) @@ -1202,6 +1514,10 @@ func (_m *Knapsack) SetInsecureTLS(insecure bool) error { func (_m *Knapsack) SetInsecureTransportTLS(insecure bool) error { ret := _m.Called(insecure) + if len(ret) == 0 { + panic("no return value specified for SetInsecureTransportTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(insecure) @@ -1216,6 +1532,10 @@ func (_m *Knapsack) SetInsecureTransportTLS(insecure bool) error { func (_m *Knapsack) SetKolideServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetKolideServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1230,6 +1550,10 @@ func (_m *Knapsack) SetKolideServerURL(url string) error { func (_m *Knapsack) SetLauncherWatchdogEnabled(enabled bool) error { ret := _m.Called(enabled) + if len(ret) == 0 { + panic("no return value specified for SetLauncherWatchdogEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enabled) @@ -1244,6 +1568,10 @@ func (_m *Knapsack) SetLauncherWatchdogEnabled(enabled bool) error { func (_m *Knapsack) SetLogIngestServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetLogIngestServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1258,6 +1586,10 @@ func (_m *Knapsack) SetLogIngestServerURL(url string) error { func (_m *Knapsack) SetLogShippingLevel(level string) error { ret := _m.Called(level) + if len(ret) == 0 { + panic("no return value specified for SetLogShippingLevel") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(level) @@ -1277,6 +1609,10 @@ func (_m *Knapsack) SetLogShippingLevelOverride(value string, duration time.Dura func (_m *Knapsack) SetLoggingInterval(interval time.Duration) error { ret := _m.Called(interval) + if len(ret) == 0 { + panic("no return value specified for SetLoggingInterval") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(interval) @@ -1291,6 +1627,10 @@ func (_m *Knapsack) SetLoggingInterval(interval time.Duration) error { func (_m *Knapsack) SetMirrorServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetMirrorServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1305,6 +1645,10 @@ func (_m *Knapsack) SetMirrorServerURL(url string) error { func (_m *Knapsack) SetOsqueryHealthcheckStartupDelay(delay time.Duration) error { ret := _m.Called(delay) + if len(ret) == 0 { + panic("no return value specified for SetOsqueryHealthcheckStartupDelay") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(delay) @@ -1319,6 +1663,10 @@ func (_m *Knapsack) SetOsqueryHealthcheckStartupDelay(delay time.Duration) error func (_m *Knapsack) SetOsqueryVerbose(verbose bool) error { ret := _m.Called(verbose) + if len(ret) == 0 { + panic("no return value specified for SetOsqueryVerbose") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(verbose) @@ -1333,6 +1681,10 @@ func (_m *Knapsack) SetOsqueryVerbose(verbose bool) error { func (_m *Knapsack) SetPinnedLauncherVersion(version string) error { ret := _m.Called(version) + if len(ret) == 0 { + panic("no return value specified for SetPinnedLauncherVersion") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(version) @@ -1347,6 +1699,10 @@ func (_m *Knapsack) SetPinnedLauncherVersion(version string) error { func (_m *Knapsack) SetPinnedOsquerydVersion(version string) error { ret := _m.Called(version) + if len(ret) == 0 { + panic("no return value specified for SetPinnedOsquerydVersion") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(version) @@ -1357,10 +1713,32 @@ func (_m *Knapsack) SetPinnedOsquerydVersion(version string) error { return r0 } +// SetSystrayRestartEnabled provides a mock function with given fields: enabled +func (_m *Knapsack) SetSystrayRestartEnabled(enabled bool) error { + ret := _m.Called(enabled) + + if len(ret) == 0 { + panic("no return value specified for SetSystrayRestartEnabled") + } + + var r0 error + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(enabled) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // SetTraceBatchTimeout provides a mock function with given fields: duration func (_m *Knapsack) SetTraceBatchTimeout(duration time.Duration) error { ret := _m.Called(duration) + if len(ret) == 0 { + panic("no return value specified for SetTraceBatchTimeout") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(duration) @@ -1375,6 +1753,10 @@ func (_m *Knapsack) SetTraceBatchTimeout(duration time.Duration) error { func (_m *Knapsack) SetTraceIngestServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetTraceIngestServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1389,6 +1771,10 @@ func (_m *Knapsack) SetTraceIngestServerURL(url string) error { func (_m *Knapsack) SetTraceSamplingRate(rate float64) error { ret := _m.Called(rate) + if len(ret) == 0 { + panic("no return value specified for SetTraceSamplingRate") + } + var r0 error if rf, ok := ret.Get(0).(func(float64) error); ok { r0 = rf(rate) @@ -1408,6 +1794,10 @@ func (_m *Knapsack) SetTraceSamplingRateOverride(value float64, duration time.Du func (_m *Knapsack) SetTufServerURL(url string) error { ret := _m.Called(url) + if len(ret) == 0 { + panic("no return value specified for SetTufServerURL") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(url) @@ -1422,6 +1812,10 @@ func (_m *Knapsack) SetTufServerURL(url string) error { func (_m *Knapsack) SetUpdateChannel(channel string) error { ret := _m.Called(channel) + if len(ret) == 0 { + panic("no return value specified for SetUpdateChannel") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(channel) @@ -1436,6 +1830,10 @@ func (_m *Knapsack) SetUpdateChannel(channel string) error { func (_m *Knapsack) SetUpdateDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for SetUpdateDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -1450,6 +1848,10 @@ func (_m *Knapsack) SetUpdateDirectory(directory string) error { func (_m *Knapsack) SetWatchdogDelaySec(sec int) error { ret := _m.Called(sec) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogDelaySec") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(sec) @@ -1464,6 +1866,10 @@ func (_m *Knapsack) SetWatchdogDelaySec(sec int) error { func (_m *Knapsack) SetWatchdogEnabled(enable bool) error { ret := _m.Called(enable) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogEnabled") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(enable) @@ -1478,6 +1884,10 @@ func (_m *Knapsack) SetWatchdogEnabled(enable bool) error { func (_m *Knapsack) SetWatchdogMemoryLimitMB(limit int) error { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogMemoryLimitMB") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(limit) @@ -1492,6 +1902,10 @@ func (_m *Knapsack) SetWatchdogMemoryLimitMB(limit int) error { func (_m *Knapsack) SetWatchdogUtilizationLimitPercent(limit int) error { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for SetWatchdogUtilizationLimitPercent") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(limit) @@ -1506,6 +1920,10 @@ func (_m *Knapsack) SetWatchdogUtilizationLimitPercent(limit int) error { func (_m *Knapsack) Slogger() *slog.Logger { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Slogger") + } + var r0 *slog.Logger if rf, ok := ret.Get(0).(func() *slog.Logger); ok { r0 = rf() @@ -1522,6 +1940,10 @@ func (_m *Knapsack) Slogger() *slog.Logger { func (_m *Knapsack) StatusLogsStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for StatusLogsStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -1538,6 +1960,10 @@ func (_m *Knapsack) StatusLogsStore() types.GetterSetterDeleterIteratorUpdaterCo func (_m *Knapsack) Stores() map[storage.Store]types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Stores") + } + var r0 map[storage.Store]types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() map[storage.Store]types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -1554,6 +1980,10 @@ func (_m *Knapsack) Stores() map[storage.Store]types.GetterSetterDeleterIterator func (_m *Knapsack) SystemSlogger() *slog.Logger { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SystemSlogger") + } + var r0 *slog.Logger if rf, ok := ret.Get(0).(func() *slog.Logger); ok { r0 = rf() @@ -1566,10 +1996,32 @@ func (_m *Knapsack) SystemSlogger() *slog.Logger { return r0 } +// SystrayRestartEnabled provides a mock function with given fields: +func (_m *Knapsack) SystrayRestartEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SystrayRestartEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // TokenStore provides a mock function with given fields: func (_m *Knapsack) TokenStore() types.GetterSetterDeleterIteratorUpdaterCounterAppender { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TokenStore") + } + var r0 types.GetterSetterDeleterIteratorUpdaterCounterAppender if rf, ok := ret.Get(0).(func() types.GetterSetterDeleterIteratorUpdaterCounterAppender); ok { r0 = rf() @@ -1586,6 +2038,10 @@ func (_m *Knapsack) TokenStore() types.GetterSetterDeleterIteratorUpdaterCounter func (_m *Knapsack) TraceBatchTimeout() time.Duration { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceBatchTimeout") + } + var r0 time.Duration if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() @@ -1600,6 +2056,10 @@ func (_m *Knapsack) TraceBatchTimeout() time.Duration { func (_m *Knapsack) TraceIngestServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceIngestServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1614,6 +2074,10 @@ func (_m *Knapsack) TraceIngestServerURL() string { func (_m *Knapsack) TraceSamplingRate() float64 { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TraceSamplingRate") + } + var r0 float64 if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() @@ -1628,6 +2092,10 @@ func (_m *Knapsack) TraceSamplingRate() float64 { func (_m *Knapsack) Transport() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Transport") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1642,6 +2110,10 @@ func (_m *Knapsack) Transport() string { func (_m *Knapsack) TufServerURL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TufServerURL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1656,6 +2128,10 @@ func (_m *Knapsack) TufServerURL() string { func (_m *Knapsack) UpdateChannel() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for UpdateChannel") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1670,6 +2146,10 @@ func (_m *Knapsack) UpdateChannel() string { func (_m *Knapsack) UpdateDirectory() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for UpdateDirectory") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1684,6 +2164,10 @@ func (_m *Knapsack) UpdateDirectory() string { func (_m *Knapsack) WatchdogDelaySec() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogDelaySec") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -1698,6 +2182,10 @@ func (_m *Knapsack) WatchdogDelaySec() int { func (_m *Knapsack) WatchdogEnabled() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogEnabled") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -1712,6 +2200,10 @@ func (_m *Knapsack) WatchdogEnabled() bool { func (_m *Knapsack) WatchdogMemoryLimitMB() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogMemoryLimitMB") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -1726,6 +2218,10 @@ func (_m *Knapsack) WatchdogMemoryLimitMB() int { func (_m *Knapsack) WatchdogUtilizationLimitPercent() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WatchdogUtilizationLimitPercent") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -1736,13 +2232,12 @@ func (_m *Knapsack) WatchdogUtilizationLimitPercent() int { return r0 } -type mockConstructorTestingTNewKnapsack interface { +// NewKnapsack creates a new instance of Knapsack. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewKnapsack(t interface { mock.TestingT Cleanup(func()) -} - -// NewKnapsack creates a new instance of Knapsack. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewKnapsack(t mockConstructorTestingTNewKnapsack) *Knapsack { +}) *Knapsack { mock := &Knapsack{} mock.Mock.Test(t) diff --git a/ee/desktop/runner/runner.go b/ee/desktop/runner/runner.go index bdbf72128..eb06ee867 100644 --- a/ee/desktop/runner/runner.go +++ b/ee/desktop/runner/runner.go @@ -939,6 +939,11 @@ func (r *DesktopUsersProcessesRunner) processLogs(uid string, stdErr io.ReadClos ) // Now, check log to see if we need to restart systray. + // Only perform the restart if the feature flag is enabled. + if !r.knapsack.SystrayRestartEnabled() { + continue + } + // We don't want to perform restarts when in modern standby. if r.knapsack.InModernStandby() { continue diff --git a/ee/desktop/runner/runner_test.go b/ee/desktop/runner/runner_test.go index 7d73da982..211a9ace5 100644 --- a/ee/desktop/runner/runner_test.go +++ b/ee/desktop/runner/runner_test.go @@ -126,6 +126,7 @@ func TestDesktopUserProcessRunner_Execute(t *testing.T) { mockKnapsack.On("DesktopEnabled").Return(true) mockKnapsack.On("Slogger").Return(slogger) mockKnapsack.On("InModernStandby").Return(false) + mockKnapsack.On("SystrayRestartEnabled").Return(false).Maybe() if os.Getenv("CI") != "true" || runtime.GOOS != "linux" { // Only expect that we call Debug (to set the DEBUG flag on the process) if we actually expect