From b583790ad975d959adaf433d7afc7c6d7ae5c62b Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Tue, 11 Jun 2024 11:43:07 -0400 Subject: [PATCH] Fix bug in TLS secret detection If someone were to successfully install the application then delete the TLSSecret, the operator would not recreate it because it detected that the Database Secret already existed. This will cause errors during reconcile when the operator tries to update the CR status. Instead, we should be checking the existence of the TLS Secret. --- manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go b/manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go index dedddde33..91d318e86 100644 --- a/manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go +++ b/manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go @@ -605,7 +605,7 @@ func HttpdDbusAPIService(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme) (*cor } func ManageTlsSecret(cr *miqv1alpha1.ManageIQ, client client.Client, scheme *runtime.Scheme) (*corev1.Secret, controllerutil.MutateFn, error) { - secretKey := types.NamespacedName{Namespace: cr.ObjectMeta.Namespace, Name: cr.Spec.DatabaseSecret} + secretKey := types.NamespacedName{Namespace: cr.ObjectMeta.Namespace, Name: tlsSecretName(cr)} secret := &corev1.Secret{} secretErr := client.Get(context.TODO(), secretKey, secret) var err error