Skip to content

Commit

Permalink
added uncordon message tmpl
Browse files Browse the repository at this point in the history
 added message template for
 announcing successful uncor-
 doning and reboot.
  • Loading branch information
atighineanu committed Jun 24, 2022
1 parent e01ed7b commit 1d1a1df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/kured/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var (
slackChannel string
messageTemplateDrain string
messageTemplateReboot string
messageTemplateUncordon string
podSelectors []string
rebootCommand string
logFormat string
Expand Down Expand Up @@ -166,6 +167,8 @@ func NewRootCommand() *cobra.Command {
"slack channel for reboot notfications")
rootCmd.PersistentFlags().StringVar(&notifyURL, "notify-url", "",
"notify URL for reboot notfications")
rootCmd.PersistentFlags().StringVar(&messageTemplateUncordon, "message-template-uncordon", "Node %s rebooted & uncordoned successfully!",
"message template used to notify about a node being successfully uncordoned")
rootCmd.PersistentFlags().StringVar(&messageTemplateDrain, "message-template-drain", "Draining node %s",
"message template used to notify about a node being drained")
rootCmd.PersistentFlags().StringVar(&messageTemplateReboot, "message-template-reboot", "Rebooting node %s",
Expand Down Expand Up @@ -637,7 +640,7 @@ func rebootAsRequired(nodeID string, rebootCommand []string, sentinelCommand []s
continue
} else {
if notifyURL != "" {
if err := shoutrrr.Send(notifyURL, fmt.Sprintf("Node: %s rebooted & uncordoned successfully!", nodeID)); err != nil {
if err := shoutrrr.Send(notifyURL, fmt.Sprintf(messageTemplateUncordon, nodeID)); err != nil {
log.Warnf("Error notifying: %v", err)
}
}
Expand Down

0 comments on commit 1d1a1df

Please sign in to comment.