Skip to content

Commit 738d2e3

Browse files
stuggiclaude
andcommitted
[lb pub endpt] Use LoadBalancer override in endpointURL SAN tests
The lib-common bump pulls in a change that uses the endpointURL host as vhost ServerName, and therefore as service cert SAN, only when the override Service type is LoadBalancer (behind a Route the router sends no SNI, so httpd would reject requests with 421). The custom hostname SAN tests set only EndpointURL on the override, so the custom host is now dropped from the cert and the tests fail. Set Spec.Type LoadBalancer on the overrides, as a real LoadBalancer endpoint's override carries it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 1048a4c commit 738d2e3

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎internal/openstack/common_test.go‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,12 @@ func TestEnsureEndpointConfig_EndpointURL_CustomHostname(t *testing.T) {
745745

746746
svcOverrides := map[service.Endpoint]service.RoutedOverrideSpec{}
747747
if tt.endpointURL != nil {
748+
// The custom host is only a SAN for a LoadBalancer override
749+
// (lib-common GetVHostServerName); the real override carries the type.
748750
svcOverrides[service.EndpointPublic] = service.RoutedOverrideSpec{
751+
OverrideSpec: service.OverrideSpec{
752+
Spec: &service.OverrideServiceSpec{Type: k8s_corev1.ServiceTypeLoadBalancer},
753+
},
749754
EndpointURL: tt.endpointURL,
750755
}
751756
}
@@ -790,7 +795,7 @@ func TestEnsureEndpointConfig_InternalEndpointURL_CustomHostname(t *testing.T) {
790795
},
791796
},
792797
Spec: k8s_corev1.ServiceSpec{
793-
Type: k8s_corev1.ServiceTypeClusterIP,
798+
Type: k8s_corev1.ServiceTypeLoadBalancer,
794799
Ports: []k8s_corev1.ServicePort{{Name: "keystone-internal", Port: 5000}},
795800
},
796801
}
@@ -805,7 +810,12 @@ func TestEnsureEndpointConfig_InternalEndpointURL_CustomHostname(t *testing.T) {
805810

806811
svcList := &k8s_corev1.ServiceList{Items: []k8s_corev1.Service{*internalSvc}}
807812
svcOverrides := map[service.Endpoint]service.RoutedOverrideSpec{
808-
service.EndpointInternal: {EndpointURL: ptr.To("https://keystone-internal.example.com")},
813+
service.EndpointInternal: {
814+
OverrideSpec: service.OverrideSpec{
815+
Spec: &service.OverrideServiceSpec{Type: k8s_corev1.ServiceTypeLoadBalancer},
816+
},
817+
EndpointURL: ptr.To("https://keystone-internal.example.com"),
818+
},
809819
}
810820

811821
_, _, err := EnsureEndpointConfig(

0 commit comments

Comments
 (0)