From 3830101800b7dec35a98c771b1ab33dd2913706a Mon Sep 17 00:00:00 2001 From: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:16:44 +0000 Subject: [PATCH] fix: allow both default & wildcard secrets to be used at the same time (#6833) --- internal/k8s/controller.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/k8s/controller.go b/internal/k8s/controller.go index 9ad044b69f..864a46e6e4 100644 --- a/internal/k8s/controller.go +++ b/internal/k8s/controller.go @@ -1778,15 +1778,14 @@ func (lbc *LoadBalancerController) validationTLSSpecialSecret(secret *api_v1.Sec func (lbc *LoadBalancerController) handleSpecialSecretUpdate(secret *api_v1.Secret) { var specialTLSSecretsToUpdate []string secretNsName := secret.Namespace + "/" + secret.Name - switch secretNsName { - case lbc.specialSecrets.defaultServerSecret: + + if secretNsName == lbc.specialSecrets.defaultServerSecret { lbc.validationTLSSpecialSecret(secret, configs.DefaultServerSecretFileName, &specialTLSSecretsToUpdate) - case lbc.specialSecrets.wildcardTLSSecret: + } + if secretNsName == lbc.specialSecrets.wildcardTLSSecret { lbc.validationTLSSpecialSecret(secret, configs.WildcardSecretFileName, &specialTLSSecretsToUpdate) - default: - nl.Warnf(lbc.Logger, "special secret not found") - return } + err := lbc.configurator.AddOrUpdateSpecialTLSSecrets(secret, specialTLSSecretsToUpdate) if err != nil { nl.Errorf(lbc.Logger, "Error when updating the special Secret %v: %v", secretNsName, err)