Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow up of a518f8fb3aa1d4dfc20fa24d9bfcbf0a5afacc31 to fix ironic #696

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading