Skip to content

Commit d6dfba2

Browse files
committed
Refactor and properly inject alertmanager values into monitoring
operator Signed-off-by: sami <sami@appscode.com>
1 parent 439556b commit d6dfba2

7 files changed

Lines changed: 248 additions & 197 deletions

File tree

apis/installer/v1alpha1/opscenter_features_types.go

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,33 @@ type AlertmanagerNotificationsSpec struct {
6666
Webhook AlertmanagerWebhookNotificationSpec `json:"webhook"`
6767
}
6868

69+
type AlertmanagerEmailSecretSpec struct {
70+
Name string `json:"name"`
71+
Key string `json:"key"`
72+
Password string `json:"password"`
73+
}
74+
75+
type AlertmanagerWebhookSecretSpec struct {
76+
Name string `json:"name"`
77+
Key string `json:"key"`
78+
URL string `json:"url"`
79+
}
80+
6981
type AlertmanagerEmailNotificationSpec struct {
70-
Enabled bool `json:"enabled"`
71-
To string `json:"to"`
72-
From string `json:"from"`
73-
Smarthost string `json:"smarthost"`
74-
AuthUsername string `json:"authUsername"`
75-
AuthSecretName string `json:"authSecretName"`
76-
AuthSecretKey string `json:"authSecretKey"`
77-
AuthPassword string `json:"authPassword"`
78-
RequireTLS bool `json:"requireTLS"`
79-
SendResolved bool `json:"sendResolved"`
82+
Enabled bool `json:"enabled"`
83+
To string `json:"to"`
84+
From string `json:"from"`
85+
Smarthost string `json:"smarthost"`
86+
AuthUsername string `json:"authUsername"`
87+
Secret AlertmanagerEmailSecretSpec `json:"secret"`
88+
RequireTLS bool `json:"requireTLS"`
89+
SendResolved bool `json:"sendResolved"`
8090
}
8191

8292
type AlertmanagerWebhookNotificationSpec struct {
83-
Enabled bool `json:"enabled"`
84-
URLSecretName string `json:"urlSecretName"`
85-
URLSecretKey string `json:"urlSecretKey"`
86-
URL string `json:"url"`
87-
SendResolved bool `json:"sendResolved"`
93+
Enabled bool `json:"enabled"`
94+
Secret AlertmanagerWebhookSecretSpec `json:"secret"`
95+
SendResolved bool `json:"sendResolved"`
8896
}
8997

9098
type OpscenterHelmSpec struct {

apis/installer/v1alpha1/zz_generated.deepcopy.go

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)