Skip to content

Commit 0d0840a

Browse files
committed
Enable TLS for glanceAPI Edge instances
When a glanceAPI Edge instance is deployed, the glance-operator creates an internal SVC, but the public one is skipped (because these instances are not exposed outside). However, we're currently not able to enable TLS because the EnsureEndpoint function is skipped due to the different size of the generated Overrides that is compared with the service list (svcs.Items). This patch fixes the current behavior and generates an internal override only for an Edge API instance type: by doing this we're able to properly execute the EnsureEndpoint function and generate both key and cert, referenced by the Edge API. Signed-off-by: Francesco Pantano <fpantano@redhat.com>
1 parent d9a3921 commit 0d0840a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎pkg/openstack/glance.go‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
5555

5656
// add selector to service overrides
5757
for name, glanceAPI := range instance.Spec.Glance.Template.GlanceAPIs {
58-
for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} {
58+
eps := []service.Endpoint{service.EndpointPublic, service.EndpointInternal}
59+
// An Edge glanceAPI has an internal endpoint only
60+
if glanceAPI.Type == glancev1.APIEdge {
61+
eps = []service.Endpoint{service.EndpointInternal}
62+
}
63+
for _, endpointType := range eps {
5964
if glanceAPI.Override.Service == nil {
6065
glanceAPI.Override.Service = map[service.Endpoint]service.RoutedOverrideSpec{}
6166
}
@@ -122,8 +127,11 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
122127
}
123128
// set service overrides
124129
glanceAPI.Override.Service = endpointDetails.GetEndpointServiceOverrides()
125-
// update TLS cert secret
126-
glanceAPI.TLS.API.Public.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointPublic)
130+
// update TLS cert secret, but skip Public endpoint for Edge
131+
// instances
132+
if glanceAPI.Type != glancev1.APIEdge {
133+
glanceAPI.TLS.API.Public.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointPublic)
134+
}
127135
glanceAPI.TLS.API.Internal.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal)
128136

129137
// let's keep track of changes for any instance, but return

0 commit comments

Comments
 (0)