-
Notifications
You must be signed in to change notification settings - Fork 103
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
prevent watchdog installation for dev environments #1802
Conversation
|
||
// IsKolideHostedServerURL is a convenience function to enable gating functionality for | ||
// developer (or other non-production) deployments | ||
func IsKolideHostedServerURL(serverURL string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice improvement
@@ -153,6 +158,17 @@ func (wc *WatchdogController) Interrupt(_ error) { | |||
|
|||
func (wc *WatchdogController) ServiceEnabledChanged(enabled bool) { | |||
ctx := context.TODO() | |||
// we don't alter watchdog installation (install or remove) if this is a non-prod deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably also check if we're running as not-root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good call, on it!
c7109cd
to
fa9f97a
Compare
There were a few places already where we gate behavior on the KolideServerURL with the same checks. This adds a helper function to check a serverURL against our match criteria, and adds this check to the watchdog installation and log publication routines