FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Set TLS certificate annotation only on gRPC service by ntkathole · Pull Request #5715 · feast-dev/feast · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .go  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,20 @@ func (feast *FeastServices) setService(svc *corev1.Service, feastType FeastServi
restEnabled := feast.isRegistryRestEnabled()

if grpcEnabled && restEnabled {
// Both services enabled: Use gRPC service name as primary, add REST as SAN
grpcSvcName := feast.initFeastSvc(RegistryFeastType).Name
svc.Annotations["service.beta.openshift.io/serving-cert-secret-name"] = grpcSvcName + tlsNameSuffix

// Add Subject Alternative Names (SANs) for both services
grpcHostname := grpcSvcName + "." + svc.Namespace + ".svc.cluster.local"
restHostname := feast.GetFeastRestServiceName(RegistryFeastType) + "." + svc.Namespace + ".svc.cluster.local"
svc.Annotations["service.beta.openshift.io/serving-cert-sans"] = grpcHostname + "," + restHostname
// Both services enabled: Only set TLS annotation on gRPC service to ensure
// OpenShift creates certificate with gRPC service name as CN (not REST service name)
// The certificate will include both hostnames as SANs
if !isRestService {
grpcSvcName := feast.initFeastSvc(RegistryFeastType).Name
svc.Annotations["service.beta.openshift.io/serving-cert-secret-name"] = grpcSvcName + tlsNameSuffix

// Add Subject Alternative Names (SANs) for both services
grpcHostname := grpcSvcName + "." + svc.Namespace + ".svc.cluster.local"
restHostname := feast.GetFeastRestServiceName(RegistryFeastType) + "." + svc.Namespace + ".svc.cluster.local"
svc.Annotations["service.beta.openshift.io/serving-cert-sans"] = grpcHostname + "," + restHostname
}
// REST service should not have the annotation - it will use the same certificate
// from the gRPC service secret (mounted in the pod)
} else if grpcEnabled && !restEnabled {
// Only gRPC enabled: Use gRPC service name
grpcSvcName := feast.initFeastSvc(RegistryFeastType).Name
Expand Down
Loading

Back | FazBrowse Home | New Git URL