diff --git a/api/go.mod b/api/go.mod index 7d3b2e33b..9028432d5 100644 --- a/api/go.mod +++ b/api/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/google/go-cmp v0.6.0 - github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d + github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6 github.com/robfig/cron/v3 v3.0.1 k8s.io/api v0.28.13 k8s.io/apimachinery v0.28.13 @@ -37,8 +37,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/onsi/ginkgo/v2 v2.20.1 // indirect - github.com/onsi/gomega v1.34.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/api/go.sum b/api/go.sum index 545cd2005..bbf6c3ea8 100644 --- a/api/go.sum +++ b/api/go.sum @@ -64,11 +64,9 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= -github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d h1:WfEUkOxDpMnnYo+mQTJc9juoY85me/V6ubNAsOHdjnc= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d/go.mod h1:YlNmaOTuZNZvwlOfosPI94od/V2Itektn9KWThRzylI= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6 h1:VSbVNzUa41hybq/lZi0L8bNv/yzYyNylc8yKSEO+ZCA= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6/go.mod h1:6zxa5xg9uvpObVKFSJa/SA+vDDlgh0Q1aswxDB2XbxU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/controllers/novaapi_controller.go b/controllers/novaapi_controller.go index 4f418d3ed..2302b2341 100644 --- a/controllers/novaapi_controller.go +++ b/controllers/novaapi_controller.go @@ -238,7 +238,7 @@ func (r *NovaAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -247,15 +247,21 @@ func (r *NovaAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { @@ -264,17 +270,23 @@ func (r *NovaAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re } // Validate API service certs secrets - certsHash, ctrlResult, err := instance.Spec.TLS.API.ValidateCertSecrets(ctx, h, instance.Namespace) + certsHash, err := instance.Spec.TLS.API.ValidateCertSecrets(ctx, h, instance.Namespace) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, err.Error()))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } hashes[tls.TLSHashName] = env.SetValue(certsHash) diff --git a/controllers/novacompute_controller.go b/controllers/novacompute_controller.go index dcf176ec9..d9bc0d7c3 100644 --- a/controllers/novacompute_controller.go +++ b/controllers/novacompute_controller.go @@ -176,7 +176,7 @@ func (r *NovaComputeReconciler) Reconcile(ctx context.Context, req ctrl.Request) // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -185,15 +185,21 @@ func (r *NovaComputeReconciler) Reconcile(ctx context.Context, req ctrl.Request) }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { diff --git a/controllers/novaconductor_controller.go b/controllers/novaconductor_controller.go index cda327e6a..c8080377d 100644 --- a/controllers/novaconductor_controller.go +++ b/controllers/novaconductor_controller.go @@ -200,7 +200,7 @@ func (r *NovaConductorReconciler) Reconcile(ctx context.Context, req ctrl.Reques // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -209,15 +209,21 @@ func (r *NovaConductorReconciler) Reconcile(ctx context.Context, req ctrl.Reques }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { diff --git a/controllers/novametadata_controller.go b/controllers/novametadata_controller.go index 7cc67c4ab..75f4d3919 100644 --- a/controllers/novametadata_controller.go +++ b/controllers/novametadata_controller.go @@ -216,7 +216,7 @@ func (r *NovaMetadataReconciler) Reconcile(ctx context.Context, req ctrl.Request // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -225,15 +225,21 @@ func (r *NovaMetadataReconciler) Reconcile(ctx context.Context, req ctrl.Request }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { @@ -243,8 +249,16 @@ func (r *NovaMetadataReconciler) Reconcile(ctx context.Context, req ctrl.Request // Validate metadata service cert secret if instance.Spec.TLS.Enabled() { - hash, ctrlResult, err := instance.Spec.TLS.ValidateCertSecret(ctx, h, instance.Namespace) + hash, err := instance.Spec.TLS.ValidateCertSecret(ctx, h, instance.Namespace) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, err.Error()))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, @@ -252,8 +266,6 @@ func (r *NovaMetadataReconciler) Reconcile(ctx context.Context, req ctrl.Request condition.TLSInputErrorMessage, err.Error())) return ctrl.Result{}, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil } hashes[tls.TLSHashName] = env.SetValue(hash) } diff --git a/controllers/novanovncproxy_controller.go b/controllers/novanovncproxy_controller.go index f4c175e3c..42aceb698 100644 --- a/controllers/novanovncproxy_controller.go +++ b/controllers/novanovncproxy_controller.go @@ -194,7 +194,7 @@ func (r *NovaNoVNCProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -203,15 +203,21 @@ func (r *NovaNoVNCProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { @@ -221,8 +227,16 @@ func (r *NovaNoVNCProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque // Validate the service cert secret if instance.Spec.TLS.Service.Enabled() { - hash, ctrlResult, err := instance.Spec.TLS.Service.ValidateCertSecret(ctx, h, instance.Namespace) + hash, err := instance.Spec.TLS.Service.ValidateCertSecret(ctx, h, instance.Namespace) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, err.Error()))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, @@ -230,16 +244,22 @@ func (r *NovaNoVNCProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque condition.TLSInputErrorMessage, err.Error())) return ctrl.Result{}, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil } hashes[tls.TLSHashName] = env.SetValue(hash) } // Validate the Vencrypt cert secret if instance.Spec.TLS.Vencrypt.Enabled() { - hash, ctrlResult, err := instance.Spec.TLS.Vencrypt.ValidateCertSecret(ctx, h, instance.Namespace) + hash, err := instance.Spec.TLS.Vencrypt.ValidateCertSecret(ctx, h, instance.Namespace) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, err.Error()))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, @@ -247,8 +267,6 @@ func (r *NovaNoVNCProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque condition.TLSInputErrorMessage, err.Error())) return ctrl.Result{}, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil } hashes[novncproxy.VencryptName] = env.SetValue(hash) } diff --git a/controllers/novascheduler_controller.go b/controllers/novascheduler_controller.go index 792b8614e..a4695f2f9 100644 --- a/controllers/novascheduler_controller.go +++ b/controllers/novascheduler_controller.go @@ -198,7 +198,7 @@ func (r *NovaSchedulerReconciler) Reconcile(ctx context.Context, req ctrl.Reques // // Validate the CA cert secret if provided if instance.Spec.TLS.CaBundleSecretName != "" { - hash, ctrlResult, err := tls.ValidateCACertSecret( + hash, err := tls.ValidateCACertSecret( ctx, h.GetClient(), types.NamespacedName{ @@ -207,15 +207,21 @@ func (r *NovaSchedulerReconciler) Reconcile(ctx context.Context, req ctrl.Reques }, ) if err != nil { + if k8s_errors.IsNotFound(err) { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.TLSInputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))) + return ctrl.Result{}, nil + } instance.Status.Conditions.Set(condition.FalseCondition( condition.TLSInputReadyCondition, condition.ErrorReason, condition.SeverityWarning, condition.TLSInputErrorMessage, err.Error())) - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + return ctrl.Result{}, err } if hash != "" { diff --git a/go.mod b/go.mod index b66e6fa14..68eef9213 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/onsi/gomega v1.34.1 github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240730162859-91b64b2d2de7 github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240730210414-ba2309d261a2 - github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d + github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6 github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20240730142703-7fd3da600c9d github.com/openstack-k8s-operators/lib-common/modules/test v0.4.1-0.20240730142703-7fd3da600c9d github.com/openstack-k8s-operators/mariadb-operator/api v0.4.1-0.20240730222151-2d771bf1a024 diff --git a/go.sum b/go.sum index 57aa6c72a..a812d6a36 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240730162859-9 github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240730162859-91b64b2d2de7/go.mod h1:OamtaW9c7aCtfUmxc/r+/XJS7XRI7s5iR//SZ8ilSwk= github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240730210414-ba2309d261a2 h1:F5NZmK9Gr12bHmNCJDRy7ad3I5j97adJ5Gm9HjSwV5g= github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240730210414-ba2309d261a2/go.mod h1:cSNSeN7+pXC/DLwtGoT9HsbdUYzbAnLHGtXN9/uugk8= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d h1:WfEUkOxDpMnnYo+mQTJc9juoY85me/V6ubNAsOHdjnc= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240730142703-7fd3da600c9d/go.mod h1:YlNmaOTuZNZvwlOfosPI94od/V2Itektn9KWThRzylI= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6 h1:VSbVNzUa41hybq/lZi0L8bNv/yzYyNylc8yKSEO+ZCA= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6/go.mod h1:6zxa5xg9uvpObVKFSJa/SA+vDDlgh0Q1aswxDB2XbxU= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20240730142703-7fd3da600c9d h1:SRB1rCIVpaVhKxJPkSXE9CNN+xHSrdgXzrRV9ed/hIc= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20240730142703-7fd3da600c9d/go.mod h1:TyZh5+Uwxb1vcyY44H5GJVulvlQxU05TTAPQ4tSmbzY= github.com/openstack-k8s-operators/lib-common/modules/test v0.4.1-0.20240730142703-7fd3da600c9d h1:P5tF3/shBcQf0HkPHWcr5Ri+jsRStMPbGOPQw4qRHRI= diff --git a/test/functional/nova_compute_ironic_controller_test.go b/test/functional/nova_compute_ironic_controller_test.go index abe01d643..0a6e2e20e 100644 --- a/test/functional/nova_compute_ironic_controller_test.go +++ b/test/functional/nova_compute_ironic_controller_test.go @@ -576,8 +576,8 @@ var _ = Describe("NovaCompute with ironic diver controller", func() { ConditionGetterFunc(NovaComputeConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( cell1.NovaComputeName, diff --git a/test/functional/nova_metadata_controller_test.go b/test/functional/nova_metadata_controller_test.go index 722492721..d3e0bbcf4 100644 --- a/test/functional/nova_metadata_controller_test.go +++ b/test/functional/nova_metadata_controller_test.go @@ -910,8 +910,8 @@ var _ = Describe("NovaMetadata controller", func() { ConditionGetterFunc(NovaMetadataConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( novaNames.MetadataName, @@ -929,8 +929,9 @@ var _ = Describe("NovaMetadata controller", func() { ConditionGetterFunc(NovaMetadataConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/internal-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.InternalCertSecretName.Name, novaNames.InternalCertSecretName.Namespace), ) th.ExpectCondition( novaNames.MetadataName, diff --git a/test/functional/nova_novncproxy_test.go b/test/functional/nova_novncproxy_test.go index aac822a17..8ce12d5d2 100644 --- a/test/functional/nova_novncproxy_test.go +++ b/test/functional/nova_novncproxy_test.go @@ -793,8 +793,8 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -812,8 +812,9 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/internal-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.InternalCertSecretName.Name, novaNames.InternalCertSecretName.Namespace), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -958,8 +959,8 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -977,8 +978,9 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/vencrypt-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.VNCProxyVencryptCertSecretName.Name, novaNames.VNCProxyVencryptCertSecretName.Namespace), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -1126,8 +1128,8 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -1145,8 +1147,9 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/internal-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.InternalCertSecretName.Name, novaNames.InternalCertSecretName.Namespace), ) th.ExpectCondition( cell1.NoVNCProxyName, @@ -1165,8 +1168,9 @@ var _ = Describe("NovaNoVNCProxy controller", func() { ConditionGetterFunc(NoVNCProxyConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/vencrypt-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.VNCProxyVencryptCertSecretName.Name, novaNames.VNCProxyVencryptCertSecretName.Namespace), ) th.ExpectCondition( cell1.NoVNCProxyName, diff --git a/test/functional/nova_scheduler_test.go b/test/functional/nova_scheduler_test.go index 7add404cd..b3feeaffe 100644 --- a/test/functional/nova_scheduler_test.go +++ b/test/functional/nova_scheduler_test.go @@ -720,8 +720,8 @@ var _ = Describe("NovaScheduler controller", func() { ConditionGetterFunc(NovaSchedulerConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( novaNames.SchedulerName, diff --git a/test/functional/novaapi_controller_test.go b/test/functional/novaapi_controller_test.go index a14417e99..570dc4848 100644 --- a/test/functional/novaapi_controller_test.go +++ b/test/functional/novaapi_controller_test.go @@ -938,8 +938,8 @@ var _ = Describe("NovaAPI controller", func() { ConditionGetterFunc(NovaAPIConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( novaNames.APIName, @@ -957,8 +957,9 @@ var _ = Describe("NovaAPI controller", func() { ConditionGetterFunc(NovaAPIConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/internal-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.InternalCertSecretName.Name, novaNames.InternalCertSecretName.Namespace), ) th.ExpectCondition( novaNames.APIName, @@ -977,8 +978,9 @@ var _ = Describe("NovaAPI controller", func() { ConditionGetterFunc(NovaAPIConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/public-tls-certs not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: secrets \"%s in namespace %s\" not found", + novaNames.PublicCertSecretName.Name, novaNames.PublicCertSecretName.Namespace), ) th.ExpectCondition( novaNames.APIName, diff --git a/test/functional/novaconductor_controller_test.go b/test/functional/novaconductor_controller_test.go index c57c3ffce..f4c5a4753 100644 --- a/test/functional/novaconductor_controller_test.go +++ b/test/functional/novaconductor_controller_test.go @@ -861,8 +861,8 @@ var _ = Describe("NovaConductor controller", func() { ConditionGetterFunc(NovaConductorConditionGetter), condition.TLSInputReadyCondition, corev1.ConditionFalse, - condition.ErrorReason, - fmt.Sprintf("TLSInput error occured in TLS sources Secret %s/combined-ca-bundle not found", novaNames.Namespace), + condition.RequestedReason, + fmt.Sprintf("TLSInput is missing: %s", novaNames.CaBundleSecretName.Name), ) th.ExpectCondition( cell0.ConductorName,