@@ -116,9 +116,26 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
116116 return ctrlResult , nil
117117 }
118118 } else {
119+ customIssuer := * instance .Spec .TLS .Ingress .Ca .CustomIssuer
120+
119121 // add CA labelselector to issuer
120- caCertSecretName , err := addIssuerLabel (ctx , helper , * instance . Spec . TLS . Ingress . Ca . CustomIssuer , instance .Namespace , issuerLabels )
122+ caCertSecretName , err := addIssuerLabel (ctx , helper , customIssuer , instance .Namespace , issuerLabels )
121123 if err != nil {
124+ instance .Status .Conditions .Set (condition .FalseCondition (
125+ corev1 .OpenStackControlPlaneCAReadyCondition ,
126+ condition .ErrorReason ,
127+ condition .SeverityWarning ,
128+ corev1 .OpenStackControlPlaneCAReadyErrorMessage ,
129+ "issuer" ,
130+ customIssuer ,
131+ err .Error ()))
132+ if k8s_errors .IsNotFound (err ) {
133+ timeout := time .Second * 10
134+ Log .Info (fmt .Sprintf ("Custom Issuer %s not found, reconcile in %s" , customIssuer , timeout .String ()))
135+
136+ return ctrl.Result {RequeueAfter : timeout }, nil
137+ }
138+
122139 return ctrlResult , err
123140 }
124141
@@ -131,7 +148,7 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
131148
132149 ctrlResult , err = ensureCaBundles (
133150 instance ,
134- * instance . Spec . TLS . Ingress . Ca . CustomIssuer ,
151+ customIssuer ,
135152 caCert ,
136153 bundle ,
137154 caOnlyBundle ,
@@ -163,9 +180,25 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
163180 return ctrlResult , nil
164181 }
165182 } else {
183+ customIssuer := * instance .Spec .TLS .PodLevel .Internal .Ca .CustomIssuer
166184 // add CA labelselector to issuer
167- caCertSecretName , err := addIssuerLabel (ctx , helper , * instance . Spec . TLS . PodLevel . Internal . Ca . CustomIssuer , instance .Namespace , issuerLabels )
185+ caCertSecretName , err := addIssuerLabel (ctx , helper , customIssuer , instance .Namespace , issuerLabels )
168186 if err != nil {
187+ instance .Status .Conditions .Set (condition .FalseCondition (
188+ corev1 .OpenStackControlPlaneCAReadyCondition ,
189+ condition .ErrorReason ,
190+ condition .SeverityWarning ,
191+ corev1 .OpenStackControlPlaneCAReadyErrorMessage ,
192+ "issuer" ,
193+ customIssuer ,
194+ err .Error ()))
195+ if k8s_errors .IsNotFound (err ) {
196+ timeout := time .Second * 10
197+ Log .Info (fmt .Sprintf ("Custom Issuer %s not found, reconcile in %s" , customIssuer , timeout .String ()))
198+
199+ return ctrl.Result {RequeueAfter : timeout }, nil
200+ }
201+
169202 return ctrlResult , err
170203 }
171204
@@ -178,7 +211,7 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
178211
179212 ctrlResult , err = ensureCaBundles (
180213 instance ,
181- * instance . Spec . TLS . PodLevel . Internal . Ca . CustomIssuer ,
214+ customIssuer ,
182215 caCert ,
183216 bundle ,
184217 caOnlyBundle ,
@@ -210,9 +243,25 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
210243 return ctrlResult , nil
211244 }
212245 } else {
246+ customIssuer := * instance .Spec .TLS .PodLevel .Ovn .Ca .CustomIssuer
213247 // add CA labelselector to issuer
214- caCertSecretName , err := addIssuerLabel (ctx , helper , * instance . Spec . TLS . PodLevel . Ovn . Ca . CustomIssuer , instance .Namespace , issuerLabels )
248+ caCertSecretName , err := addIssuerLabel (ctx , helper , customIssuer , instance .Namespace , issuerLabels )
215249 if err != nil {
250+ instance .Status .Conditions .Set (condition .FalseCondition (
251+ corev1 .OpenStackControlPlaneCAReadyCondition ,
252+ condition .ErrorReason ,
253+ condition .SeverityWarning ,
254+ corev1 .OpenStackControlPlaneCAReadyErrorMessage ,
255+ "issuer" ,
256+ customIssuer ,
257+ err .Error ()))
258+ if k8s_errors .IsNotFound (err ) {
259+ timeout := time .Second * 10
260+ Log .Info (fmt .Sprintf ("Custom Issuer %s not found, reconcile in %s" , customIssuer , timeout .String ()))
261+
262+ return ctrl.Result {RequeueAfter : timeout }, nil
263+ }
264+
216265 return ctrlResult , err
217266 }
218267
@@ -225,7 +274,7 @@ func ReconcileCAs(ctx context.Context, instance *corev1.OpenStackControlPlane, h
225274
226275 ctrlResult , err = ensureCaBundles (
227276 instance ,
228- * instance . Spec . TLS . PodLevel . Ovn . Ca . CustomIssuer ,
277+ customIssuer ,
229278 caCert ,
230279 bundle ,
231280 caOnlyBundle ,
0 commit comments