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