Make replyToAddress optional
[ZITADOPER-1]
This commit is contained in:
@@ -221,7 +221,6 @@ spec:
|
||||
type: string
|
||||
required:
|
||||
- host
|
||||
- replyToAddress
|
||||
- senderAddress
|
||||
- senderName
|
||||
- tls
|
||||
|
||||
@@ -42,7 +42,7 @@ type SMTPConfig struct {
|
||||
Host string `json:"host"`
|
||||
User *string `json:"user,omitempty"`
|
||||
Password *Password `json:"password,omitempty"`
|
||||
ReplyToAddress string `json:"replyToAddress"`
|
||||
ReplyToAddress *string `json:"replyToAddress,omitempty"`
|
||||
}
|
||||
|
||||
type DomainSettings struct {
|
||||
|
||||
@@ -668,6 +668,11 @@ func (in *SMTPConfig) DeepCopyInto(out *SMTPConfig) {
|
||||
*out = new(Password)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ReplyToAddress != nil {
|
||||
in, out := &in.ReplyToAddress, &out.ReplyToAddress
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMTPConfig.
|
||||
|
||||
@@ -222,7 +222,6 @@ spec:
|
||||
type: string
|
||||
required:
|
||||
- host
|
||||
- replyToAddress
|
||||
- senderAddress
|
||||
- senderName
|
||||
- tls
|
||||
|
||||
@@ -463,11 +463,10 @@ func (r *ZitadelClusterReconciler) reconcileSMTPConfig(ctx context.Context, zita
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
adminRequest := &adm.AddSMTPConfigRequest{
|
||||
SenderAddress: zitadel.Spec.SMTPConfig.SenderAddress,
|
||||
SenderName: zitadel.Spec.SMTPConfig.SenderName,
|
||||
Tls: zitadel.Spec.SMTPConfig.TLS,
|
||||
Host: zitadel.Spec.SMTPConfig.Host,
|
||||
ReplyToAddress: zitadel.Spec.SMTPConfig.ReplyToAddress,
|
||||
SenderAddress: zitadel.Spec.SMTPConfig.SenderAddress,
|
||||
SenderName: zitadel.Spec.SMTPConfig.SenderName,
|
||||
Tls: zitadel.Spec.SMTPConfig.TLS,
|
||||
Host: zitadel.Spec.SMTPConfig.Host,
|
||||
}
|
||||
if zitadel.Spec.SMTPConfig.User != nil && zitadel.Spec.SMTPConfig.Password != nil {
|
||||
passwordSecret, err := r.RefResolver.SecretKeyRef(ctx, zitadel.Spec.SMTPConfig.Password.SecretKeyRef, zitadel.Namespace)
|
||||
@@ -477,6 +476,9 @@ func (r *ZitadelClusterReconciler) reconcileSMTPConfig(ctx context.Context, zita
|
||||
adminRequest.Password = passwordSecret
|
||||
adminRequest.User = *zitadel.Spec.SMTPConfig.User
|
||||
}
|
||||
if zitadel.Spec.SMTPConfig.ReplyToAddress != nil {
|
||||
adminRequest.ReplyToAddress = *zitadel.Spec.SMTPConfig.ReplyToAddress
|
||||
}
|
||||
|
||||
if _, err = adminClient.AddSMTPConfig(ctx, adminRequest); err != nil {
|
||||
return ctrl.Result{}, fmt.Errorf("Could not add SMTP config: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user