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

🚀 Support disabling startup message for notifications channels #233

Merged
merged 1 commit into from
Jun 19, 2023
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
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