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