Skip to content

Commit 57d3317

Browse files
committed
Additional SubjectName in the CertificateRequest
This patch adds a way to check the appropriate annotation within a SVC and look for additional SNs that should be added to the CertificateRequest. Glance needs this mechanism because for each SVC (public, internal), we have an associated headless service, and it is used to resolve each replica Pod worker_self_reference_url. This allows to proxy Pod2Pod requests via HTTPS. Signed-off-by: Francesco Pantano <[email protected]>
1 parent c2019c1 commit 57d3317

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/openstack/common.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ func EnsureEndpointConfig(
298298
Labels: util.MergeMaps(ed.Labels, map[string]string{serviceCertSelector: ""}),
299299
Usages: nil,
300300
}
301+
302+
addSubjNames := util.GetStringListFromMap(svc.Annotations, tls.AdditionalSubjectNamesKey)
303+
if len(addSubjNames) > 0 {
304+
certRequest.Hostnames = append(certRequest.Hostnames, addSubjNames...)
305+
}
301306
if instance.Spec.TLS.Ingress.Cert.Duration != nil {
302307
certRequest.Duration = &instance.Spec.TLS.Ingress.Cert.Duration.Duration
303308
}
@@ -343,6 +348,11 @@ func EnsureEndpointConfig(
343348
Labels: util.MergeMaps(ed.Labels, map[string]string{serviceCertSelector: ""}),
344349
Usages: nil,
345350
}
351+
352+
addSubjNames := util.GetStringListFromMap(svc.Annotations, tls.AdditionalSubjectNamesKey)
353+
if len(addSubjNames) > 0 {
354+
certRequest.Hostnames = append(certRequest.Hostnames, addSubjNames...)
355+
}
346356
if instance.Spec.TLS.PodLevel.Internal.Cert.Duration != nil {
347357
certRequest.Duration = &instance.Spec.TLS.PodLevel.Internal.Cert.Duration.Duration
348358
}

0 commit comments

Comments
 (0)