diff --git a/controllers/glance_common.go b/controllers/glance_common.go index 8b97b4e6..9748d1d3 100644 --- a/controllers/glance_common.go +++ b/controllers/glance_common.go @@ -39,6 +39,7 @@ import ( "k8s.io/apimachinery/pkg/labels" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" ) // fields to index to reconcile when change @@ -81,12 +82,13 @@ func ensureSecret( hash, res, err := oko_secret.VerifySecret(ctx, secretName, expectedFields, reader, requeueTimeout) if err != nil { if k8s_errors.IsNotFound(err) { + log.FromContext(ctx).Info(fmt.Sprintf("OpenStack secret %s not found", secretName)) conditionUpdater.Set(condition.FalseCondition( condition.InputReadyCondition, condition.RequestedReason, condition.SeverityInfo, condition.InputReadyWaitingMessage)) - return "", glance.ResultRequeue, fmt.Errorf("OpenStack secret %s not found", secretName) + return "", glance.ResultRequeue, nil } conditionUpdater.Set(condition.FalseCondition( condition.InputReadyCondition, @@ -117,13 +119,14 @@ func ensureNAD( _, err = nad.GetNADWithName(ctx, helper, netAtt, helper.GetBeforeObject().GetNamespace()) if err != nil { if k8s_errors.IsNotFound(err) { + helper.GetLogger().Info(fmt.Sprintf("network-attachment-definition %s not found", netAtt)) conditionUpdater.Set(condition.FalseCondition( condition.NetworkAttachmentsReadyCondition, condition.RequestedReason, condition.SeverityInfo, condition.NetworkAttachmentsReadyWaitingMessage, netAtt)) - return serviceAnnotations, ctrl.Result{RequeueAfter: time.Second * 10}, fmt.Errorf("network-attachment-definition %s not found", netAtt) + return serviceAnnotations, glance.ResultRequeue, nil } conditionUpdater.Set(condition.FalseCondition( condition.NetworkAttachmentsReadyCondition, diff --git a/controllers/glance_controller.go b/controllers/glance_controller.go index e5634c72..9759a935 100644 --- a/controllers/glance_controller.go +++ b/controllers/glance_controller.go @@ -408,7 +408,8 @@ func (r *GlanceReconciler) reconcileInit( _, _, err := oko_secret.GetSecret(ctx, helper, instance.Spec.Secret, instance.Namespace) if err != nil { if k8s_errors.IsNotFound(err) { - return glance.ResultRequeue, fmt.Errorf("OpenStack secret %s not found", instance.Spec.Secret) + r.Log.Info(fmt.Sprintf("OpenStack secret %s not found", instance.Spec.Secret)) + return glance.ResultRequeue, nil } return ctrl.Result{}, err } diff --git a/controllers/glanceapi_controller.go b/controllers/glanceapi_controller.go index dced08f0..7b87cdc0 100644 --- a/controllers/glanceapi_controller.go +++ b/controllers/glanceapi_controller.go @@ -612,12 +612,13 @@ func (r *GlanceAPIReconciler) reconcileNormal( memcached, err := memcachedv1.GetMemcachedByName(ctx, helper, instance.Spec.MemcachedInstance, instance.Namespace) if err != nil { if k8s_errors.IsNotFound(err) { + r.Log.Info(fmt.Sprintf("memcached %s not found", instance.Spec.MemcachedInstance)) instance.Status.Conditions.Set(condition.FalseCondition( condition.MemcachedReadyCondition, condition.RequestedReason, condition.SeverityInfo, condition.MemcachedReadyWaitingMessage)) - return glance.ResultRequeue, fmt.Errorf("memcached %s not found", instance.Spec.MemcachedInstance) + return glance.ResultRequeue, nil } instance.Status.Conditions.Set(condition.FalseCondition( condition.MemcachedReadyCondition, @@ -1161,7 +1162,8 @@ func (r *GlanceAPIReconciler) ensureKeystoneEndpoints( // the registered endpoints with the new URL. err = keystonev1.DeleteKeystoneEndpointWithName(ctx, helper, instance.Name, instance.Namespace) if err != nil { - return glance.ResultRequeue, fmt.Errorf("Endpoint %s not found", instance.Name) + r.Log.Info(fmt.Sprintf("Endpoint %s not found", instance.Name)) + return glance.ResultRequeue, nil } return ctrlResult, nil }