Skip to content

Commit

Permalink
Merge pull request #696 from stuggi/fix_ironic
Browse files Browse the repository at this point in the history
follow up of a518f8f to fix ironic
  • Loading branch information
openshift-merge-bot[bot] authored Mar 7, 2024
2 parents 3d35364 + 6c4b8ae commit 1e1b1c6
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions pkg/openstack/ironic.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,30 @@ func ReconcileIronic(ctx context.Context, instance *corev1beta1.OpenStackControl
return ctrl.Result{}, err
}

endpointDetails, ctrlResult, err := EnsureEndpointConfig(
ctx,
instance,
helper,
ironic,
svcs,
instance.Spec.Ironic.Template.IronicAPI.Override.Service,
instance.Spec.Ironic.APIOverride,
corev1beta1.OpenStackControlPlaneExposeIronicReadyCondition,
false, // TODO (mschuppert) could be removed when all integrated service support TLS
)
if err != nil {
return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
return ctrlResult, nil
}
// make sure to get to EndpointConfig when all service got created
if len(svcs.Items) == len(instance.Spec.Ironic.Template.IronicAPI.Override.Service) {
endpointDetails, ctrlResult, err := EnsureEndpointConfig(
ctx,
instance,
helper,
ironic,
svcs,
instance.Spec.Ironic.Template.IronicAPI.Override.Service,
instance.Spec.Ironic.APIOverride,
corev1beta1.OpenStackControlPlaneExposeIronicReadyCondition,
false, // TODO (mschuppert) could be removed when all integrated service support TLS
)
if err != nil {
return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
return ctrlResult, nil
}

instance.Spec.Ironic.Template.IronicAPI.Override.Service = endpointDetails.GetEndpointServiceOverrides()
// update TLS settings with cert secret
instance.Spec.Ironic.Template.IronicAPI.TLS.API.Public.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointPublic)
instance.Spec.Ironic.Template.IronicAPI.TLS.API.Internal.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal)
instance.Spec.Ironic.Template.IronicAPI.Override.Service = endpointDetails.GetEndpointServiceOverrides()
// update TLS settings with cert secret
instance.Spec.Ironic.Template.IronicAPI.TLS.API.Public.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointPublic)
instance.Spec.Ironic.Template.IronicAPI.TLS.API.Internal.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal)
}

// Ironic Inspector
svcs, err = service.GetServicesListWithLabel(
Expand All @@ -116,8 +119,8 @@ func ReconcileIronic(ctx context.Context, instance *corev1beta1.OpenStackControl
}

// make sure to get to EndpointConfig when all service got created
if len(svcs.Items) == len(instance.Spec.Ironic.Template.IronicAPI.Override.Service) {
endpointDetails, ctrlResult, err = EnsureEndpointConfig(
if len(svcs.Items) == len(instance.Spec.Ironic.Template.IronicInspector.Override.Service) {
endpointDetails, ctrlResult, err := EnsureEndpointConfig(
ctx,
instance,
helper,
Expand Down

0 comments on commit 1e1b1c6

Please sign in to comment.