@@ -82,27 +82,30 @@ func ReconcileIronic(ctx context.Context, instance *corev1beta1.OpenStackControl
8282 return ctrl.Result {}, err
8383 }
8484
85- endpointDetails , ctrlResult , err := EnsureEndpointConfig (
86- ctx ,
87- instance ,
88- helper ,
89- ironic ,
90- svcs ,
91- instance .Spec .Ironic .Template .IronicAPI .Override .Service ,
92- instance .Spec .Ironic .APIOverride ,
93- corev1beta1 .OpenStackControlPlaneExposeIronicReadyCondition ,
94- false , // TODO (mschuppert) could be removed when all integrated service support TLS
95- )
96- if err != nil {
97- return ctrlResult , err
98- } else if (ctrlResult != ctrl.Result {}) {
99- return ctrlResult , nil
100- }
85+ // make sure to get to EndpointConfig when all service got created
86+ if len (svcs .Items ) == len (instance .Spec .Ironic .Template .IronicAPI .Override .Service ) {
87+ endpointDetails , ctrlResult , err := EnsureEndpointConfig (
88+ ctx ,
89+ instance ,
90+ helper ,
91+ ironic ,
92+ svcs ,
93+ instance .Spec .Ironic .Template .IronicAPI .Override .Service ,
94+ instance .Spec .Ironic .APIOverride ,
95+ corev1beta1 .OpenStackControlPlaneExposeIronicReadyCondition ,
96+ false , // TODO (mschuppert) could be removed when all integrated service support TLS
97+ )
98+ if err != nil {
99+ return ctrlResult , err
100+ } else if (ctrlResult != ctrl.Result {}) {
101+ return ctrlResult , nil
102+ }
101103
102- instance .Spec .Ironic .Template .IronicAPI .Override .Service = endpointDetails .GetEndpointServiceOverrides ()
103- // update TLS settings with cert secret
104- instance .Spec .Ironic .Template .IronicAPI .TLS .API .Public .SecretName = endpointDetails .GetEndptCertSecret (service .EndpointPublic )
105- instance .Spec .Ironic .Template .IronicAPI .TLS .API .Internal .SecretName = endpointDetails .GetEndptCertSecret (service .EndpointInternal )
104+ instance .Spec .Ironic .Template .IronicAPI .Override .Service = endpointDetails .GetEndpointServiceOverrides ()
105+ // update TLS settings with cert secret
106+ instance .Spec .Ironic .Template .IronicAPI .TLS .API .Public .SecretName = endpointDetails .GetEndptCertSecret (service .EndpointPublic )
107+ instance .Spec .Ironic .Template .IronicAPI .TLS .API .Internal .SecretName = endpointDetails .GetEndptCertSecret (service .EndpointInternal )
108+ }
106109
107110 // Ironic Inspector
108111 svcs , err = service .GetServicesListWithLabel (
@@ -116,8 +119,8 @@ func ReconcileIronic(ctx context.Context, instance *corev1beta1.OpenStackControl
116119 }
117120
118121 // make sure to get to EndpointConfig when all service got created
119- if len (svcs .Items ) == len (instance .Spec .Ironic .Template .IronicAPI .Override .Service ) {
120- endpointDetails , ctrlResult , err = EnsureEndpointConfig (
122+ if len (svcs .Items ) == len (instance .Spec .Ironic .Template .IronicInspector .Override .Service ) {
123+ endpointDetails , ctrlResult , err : = EnsureEndpointConfig (
121124 ctx ,
122125 instance ,
123126 helper ,
0 commit comments