@@ -225,11 +225,27 @@ func (r *BarbicanAPIReconciler) verifySecret(
225225 err .Error ()))
226226 return ctrl.Result {}, err
227227 } else if (result != ctrl.Result {}) {
228+ // This function is used in different contexts, but only one of them, for the transport URL secret,
229+ // involves a secret that is automatically created elsewhere. For the other contexts, we treat this
230+ // as a warning because it means that the service will not be able to start while we are waiting for
231+ // the secret to be created manually by the user.
232+
233+ var reason condition.Reason
234+ var severity condition.Severity
235+
236+ if expectedFields != nil && slices .Contains (expectedFields , TransportURL ) {
237+ reason = condition .RequestedReason
238+ severity = condition .SeverityInfo
239+ } else {
240+ reason = condition .ErrorReason
241+ severity = condition .SeverityWarning
242+ }
243+
228244 Log .Info (fmt .Sprintf ("OpenStack secret %s not found" , secretName ))
229245 instance .Status .Conditions .Set (condition .FalseCondition (
230246 condition .InputReadyCondition ,
231- condition . RequestedReason ,
232- condition . SeverityInfo ,
247+ reason ,
248+ severity ,
233249 condition .InputReadyWaitingMessage ))
234250 return result , nil
235251 }
@@ -632,10 +648,12 @@ func (r *BarbicanAPIReconciler) reconcileNormal(ctx context.Context, instance *b
632648 )
633649 if err != nil {
634650 if k8s_errors .IsNotFound (err ) {
651+ // Since the CA cert secret should have been manually created by the user and provided in the spec,
652+ // we treat this as a warning because it means that the service will not be able to start.
635653 instance .Status .Conditions .Set (condition .FalseCondition (
636654 condition .TLSInputReadyCondition ,
637- condition .RequestedReason ,
638- condition .SeverityInfo ,
655+ condition .ErrorReason ,
656+ condition .SeverityWarning ,
639657 condition .TLSInputReadyWaitingMessage ,
640658 instance .Spec .TLS .CaBundleSecretName ))
641659 return ctrl.Result {}, nil
@@ -659,6 +677,8 @@ func (r *BarbicanAPIReconciler) reconcileNormal(ctx context.Context, instance *b
659677 certsHash , err := instance .Spec .TLS .API .ValidateCertSecrets (ctx , helper , instance .Namespace )
660678 if err != nil {
661679 if k8s_errors .IsNotFound (err ) {
680+ // Since the OpenStackControlPlane creates the API service certs secrets,
681+ // we treat this as an info (because the user is not responsible for manually creating them).
662682 instance .Status .Conditions .Set (condition .FalseCondition (
663683 condition .TLSInputReadyCondition ,
664684 condition .RequestedReason ,
@@ -710,11 +730,13 @@ func (r *BarbicanAPIReconciler) reconcileNormal(ctx context.Context, instance *b
710730 nad , err := nad .GetNADWithName (ctx , helper , netAtt , instance .Namespace )
711731 if err != nil {
712732 if k8s_errors .IsNotFound (err ) {
733+ // Since the net-attach-def CR should have been manually created by the user and referenced in the spec,
734+ // we treat this as a warning because it means that the service will not be able to start.
713735 Log .Info (fmt .Sprintf ("network-attachment-definition %s not found" , netAtt ))
714736 instance .Status .Conditions .Set (condition .FalseCondition (
715737 condition .NetworkAttachmentsReadyCondition ,
716- condition .RequestedReason ,
717- condition .SeverityInfo ,
738+ condition .ErrorReason ,
739+ condition .SeverityWarning ,
718740 condition .NetworkAttachmentsReadyWaitingMessage ,
719741 netAtt ))
720742 return ctrl.Result {RequeueAfter : time .Second * 10 }, nil
0 commit comments