@@ -248,25 +248,25 @@ func EnsureEndpointConfig(
248248 if ingressOverride .TLS != nil && ingressOverride .TLS .SecretName != "" {
249249 ed .Route .TLS .SecretName = ptr .To (ingressOverride .TLS .SecretName )
250250 validateSecret := & tls.GenericService {SecretName : ed .Route .TLS .SecretName }
251- _ , ctrlResult , err := validateSecret .ValidateCertSecret (ctx , helper , instance .GetNamespace ())
251+ _ , err := validateSecret .ValidateCertSecret (ctx , helper , instance .GetNamespace ())
252252 if err != nil {
253+ if k8s_errors .IsNotFound (err ) {
254+ instance .Status .Conditions .Set (condition .FalseCondition (
255+ corev1 .OpenStackControlPlaneCustomTLSReadyCondition ,
256+ condition .RequestedReason ,
257+ condition .SeverityInfo ,
258+ corev1 .OpenStackControlPlaneCustomTLSReadyWaitingMessage ,
259+ ingressOverride .TLS .SecretName ))
260+ return endpoints , ctrl.Result {RequeueAfter : time .Duration (10 ) * time .Second }, nil
261+ }
253262 instance .Status .Conditions .Set (condition .FalseCondition (
254263 corev1 .OpenStackControlPlaneCustomTLSReadyCondition ,
255264 condition .ErrorReason ,
256265 condition .SeverityWarning ,
257266 corev1 .OpenStackControlPlaneCustomTLSReadyErrorMessage ,
258267 ingressOverride .TLS .SecretName ,
259268 err .Error ()))
260-
261- return endpoints , ctrlResult , err
262- } else if (ctrlResult != ctrl.Result {}) {
263- instance .Status .Conditions .Set (condition .FalseCondition (
264- corev1 .OpenStackControlPlaneCustomTLSReadyCondition ,
265- condition .RequestedReason ,
266- condition .SeverityInfo ,
267- corev1 .OpenStackControlPlaneCustomTLSReadyWaitingMessage ,
268- ingressOverride .TLS .SecretName ))
269- return endpoints , ctrlResult , nil
269+ return endpoints , ctrl.Result {}, err
270270 }
271271 instance .Status .Conditions .MarkTrue (corev1 .OpenStackControlPlaneCustomTLSReadyCondition ,
272272 corev1 .OpenStackControlPlaneCustomTLSReadyMessage )
@@ -284,11 +284,12 @@ func EnsureEndpointConfig(
284284 // a LoadBalancer (MetalLB) for the public endpoints.
285285 if ! ed .Route .Create && (tlsConfig .API .Public .SecretName != nil && * tlsConfig .API .Public .SecretName != "" ) {
286286 ed .Service .TLS .SecretName = tlsConfig .API .Public .SecretName
287- _ , ctrlResult , err := ed .Service .TLS .GenericService .ValidateCertSecret (ctx , helper , instance .GetNamespace ())
287+ _ , err := ed .Service .TLS .GenericService .ValidateCertSecret (ctx , helper , instance .GetNamespace ())
288288 if err != nil {
289- return endpoints , ctrlResult , err
290- } else if (ctrlResult != ctrl.Result {}) {
291- return endpoints , ctrlResult , nil
289+ if k8s_errors .IsNotFound (err ) {
290+ return endpoints , ctrl.Result {RequeueAfter : time .Duration (10 ) * time .Second }, nil
291+ }
292+ return endpoints , ctrl.Result {}, err
292293 }
293294 } else {
294295 // issue a certificate for public pod virthost
0 commit comments