From 4295fb70d8365aad4cc0ce19f2c18981f57793fb Mon Sep 17 00:00:00 2001 From: Haim Kortovich Date: Tue, 31 Dec 2024 11:07:42 -0500 Subject: [PATCH] fix error message handling activating smtp [ZITADOPER-7] --- src/internal/controller/zitadelcluster_controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal/controller/zitadelcluster_controller.go b/src/internal/controller/zitadelcluster_controller.go index 2e4f414..d09b15c 100644 --- a/src/internal/controller/zitadelcluster_controller.go +++ b/src/internal/controller/zitadelcluster_controller.go @@ -584,7 +584,9 @@ func (r *ZitadelClusterReconciler) reconcileSMTPConfig(ctx context.Context, zita if _, err := adminClient.ActivateSMTPConfig(ctx, &adm.ActivateSMTPConfigRequest{ Id: smtpId, }); err != nil { - return ctrl.Result{}, fmt.Errorf("Error activating SMTP config: %v", err) + if !strings.Contains(err.Error(), "AlreadyActive") { + return ctrl.Result{}, fmt.Errorf("Error activating SMTP config: %v", err) + } } patch := client.MergeFrom(zitadel.DeepCopy()) zitadel.Status.SMTPProviderId = smtpId