Skip to content

Commit

Permalink
🚀 Support disabling startup message for notifications channels (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
abahmed authored Jun 19, 2023
1 parent a0d7260 commit 69df9b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.8.3/deploy/
|:------------------------------|:------------------------------------------- |
| `app.proxyURL` | used in outgoing http(s) requests except Kubernetes requests to cluster optionally |
| `app.clusterName` | used in notifications to indicate which cluster has issue |
| `app.disableStartupMessage` | If set to true, welcome message will not be sent to notification channels |

### Upgrader

Expand Down
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ type App struct {
// ClusterName to used in notifications to indicate which cluster has
// issue
ClusterName string `yaml:"clusterName"`

// DisableUpdateCheck if set to true, welcome message will not be
// sent to configured notification channels
DisableStartupMessage bool `yaml:"disableStartupMessage"`
}

// Upgrader confing struct
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ func main() {
alertManager := alertmanager.AlertManager{}
alertManager.Init(config.Alert, &config.App)

// send notification to providers
alertManager.Notify(fmt.Sprintf(constant.WelcomeMsg, version.Short()))
if !config.App.DisableStartupMessage {
// send notification to providers
alertManager.Notify(fmt.Sprintf(constant.WelcomeMsg, version.Short()))
}

// check and notify if newer versions are available
upgrader := upgrader.NewUpgrader(&config.Upgrader, &alertManager)
Expand Down

0 comments on commit 69df9b8

Please sign in to comment.