feat: add tls

This commit is contained in:
Jonas Kaninda
2024-11-27 20:54:41 +01:00
parent 19d12f40c7
commit 46d1851f08
7 changed files with 100 additions and 22 deletions

View File

@@ -21,6 +21,13 @@ func gatewayConfig(r GatewayReconciler, ctx context.Context, req ctrl.Request, g
gomaConfig := &GatewayConfig{}
gomaConfig.Version = GatewayConfigVersion
gomaConfig.Gateway = mapToGateway(gateway.Spec)
// attach cert files
if len(gateway.Spec.Server.TlsSecretName) != 0 {
gomaConfig.Gateway.SSLKeyFile = TLSKeyFile
gomaConfig.Gateway.SSLCertFile = TLSCertFile
}
labelSelector := client.MatchingLabels{}
var middlewareNames []string
// List ConfigMaps in the namespace with the matching label
@@ -60,6 +67,11 @@ func updateGatewayConfig(r RouteReconciler, ctx context.Context, req ctrl.Reques
gomaConfig := &GatewayConfig{}
gomaConfig.Version = GatewayConfigVersion
gomaConfig.Gateway = mapToGateway(gateway.Spec)
// attach cert files
if len(gateway.Spec.Server.TlsSecretName) != 0 {
gomaConfig.Gateway.SSLKeyFile = TLSKeyFile
gomaConfig.Gateway.SSLCertFile = TLSCertFile
}
labelSelector := client.MatchingLabels{}
var middlewareNames []string
// List ConfigMaps in the namespace with the matching label