Skip to content

Commit

Permalink
Add flag to control Config Watcher (#152)
Browse files Browse the repository at this point in the history
This commit,
- adds `config.settings.configwatcher` to enable/disable config watcher
- updates info in all config.yaml files
  • Loading branch information
codenio authored and PrasadG193 committed Aug 12, 2019
1 parent fc5362b commit a481321
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,7 @@ settings:
clustername: not-configured
# Set true to enable kubectl commands execution
allowkubectl: false
# Set true to enable config watcher
configwatcher: true
# Set false to disable upgrade notification
upgradeNotifier: true
2 changes: 2 additions & 0 deletions deploy-all-in-one-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ data:
clustername: not-configured
# Set true to enable kubectl commands execution
allowkubectl: false
# Set true to enable config watcher
configwatcher: true
# Set false to disable upgrade notification
upgradeNotifier: true
---
Expand Down
2 changes: 2 additions & 0 deletions deploy-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ data:
clustername: not-configured
# Set true to enable kubectl commands execution
allowkubectl: false
# Set true to enable config watcher
configwatcher: true
# Set false to disable upgrade notification
upgradeNotifier: true
---
Expand Down
2 changes: 2 additions & 0 deletions helm/botkube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ config:
clustername: not-configured
# Set true to enable kubectl commands execution
allowkubectl: false
# Set true to enable config watcher
configwatcher: true
# Set false to disable upgrade notification
upgradeNotifier: true

Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Mattermost struct {
type Settings struct {
ClusterName string
AllowKubectl bool
ConfigWatcher bool
UpgradeNotifier bool `yaml:"upgradeNotifier"`
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ func RegisterInformers(c *config.Config) {
sendMessage(c, fmt.Sprintf(controllerStartMsg, c.Settings.ClusterName))
startTime = time.Now()

// Start config file watcher
go configWatcher(c)
// Start config file watcher if enabled
if c.Settings.ConfigWatcher {
go configWatcher(c)
}

// Register informers for resource lifecycle events
if len(c.Resources) > 0 {
Expand Down

0 comments on commit a481321

Please sign in to comment.