From 8e469467c6b8935a22fee91700b9106e10810381 Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Thu, 2 Nov 2023 16:25:11 -0400 Subject: [PATCH] update --- internal/controllers/certmanager.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/controllers/certmanager.go b/internal/controllers/certmanager.go index 0ed52830e..7f86ce51f 100644 --- a/internal/controllers/certmanager.go +++ b/internal/controllers/certmanager.go @@ -137,8 +137,12 @@ func (r *Reconciler) setupTLS(ctx context.Context, cr *model.CryostatInstance) ( if err != nil { return nil, err } - namespaceSecret := secret.DeepCopy() - namespaceSecret.Namespace = ns + namespaceSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: secret.Name, + Namespace: ns, + }, + } err = r.deleteSecret(ctx, namespaceSecret) if err != nil { return nil, err