Add SMTP notification provider

This commit is contained in:
Jakub Al-Khalili
2019-10-17 09:50:40 +02:00
parent 3f801cd180
commit dfd0b54579
5 changed files with 281 additions and 0 deletions
@@ -73,6 +73,7 @@ type Notification struct {
Slack *Slack `json:"slack,omitempty"`
Teams *MicrosoftTeams `json:"teams,omitempty"`
Mailgun *Mailgun `json:"mailgun,omitempty"`
SMTP *SMTP `json:"smtp,omitempty"`
}
// Slack is handler for Slack notification channel
@@ -81,6 +82,16 @@ type Slack struct {
WebHookURLSecretKeySelector SecretKeySelector `json:"webHookURLSecretKeySelector"`
}
type SMTP struct {
UsernameSecretKeySelector SecretKeySelector `json:"usernameSecretKeySelector"`
PasswordSecretKeySelector SecretKeySelector `json:"passwordSecretKeySelector"`
Port int `json:"port"`
Server string `json:"server"`
TLSInsecureSkipVerify bool `json:"tlsInsecureSkipVerify,omitempty"`
From string `json:"from"`
To string `json:"to"`
}
// MicrosoftTeams is handler for Microsoft MicrosoftTeams notification channel
type MicrosoftTeams struct {
// The web hook URL to MicrosoftTeams App
@@ -458,6 +458,11 @@ func (in *Notification) DeepCopyInto(out *Notification) {
*out = new(Mailgun)
**out = **in
}
if in.SMTP != nil {
in, out := &in.SMTP, &out.SMTP
*out = new(SMTP)
**out = **in
}
return
}
@@ -504,6 +509,24 @@ func (in *Restore) DeepCopy() *Restore {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SMTP) DeepCopyInto(out *SMTP) {
*out = *in
out.UsernameSecretKeySelector = in.UsernameSecretKeySelector
out.PasswordSecretKeySelector = in.PasswordSecretKeySelector
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMTP.
func (in *SMTP) DeepCopy() *SMTP {
if in == nil {
return nil
}
out := new(SMTP)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) {
*out = *in