Skip to content

Commit 66ce6a5

Browse files
authored
Merge pull request #99 from kgateway-dev/codex/issue_59_11_tls_fix
agentgateway: drop unsupported frontend TLS annotations
2 parents 45825e0 + f4ec26e commit 66ce6a5

18 files changed

Lines changed: 12 additions & 766 deletions

File tree

pkg/i2gw/emitter_intermediate/intermediate_representation.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ type BackendTLSPolicy struct {
161161
Hostname string
162162
}
163163

164-
// FrontendTLSPolicy defines frontend TLS listener policy extracted from annotations.
165-
type FrontendTLSPolicy struct {
166-
HandshakeTimeout *metav1.Duration
167-
ALPNProtocols []string
168-
}
169-
170164
// Policy describes per-Ingress policy knobs projected by providers.
171165
type Policy struct {
172166
ClientBodyBufferSize *resource.Quantity
@@ -182,7 +176,6 @@ type Policy struct {
182176
SessionAffinity *SessionAffinityPolicy
183177
LoadBalancing *BackendLoadBalancingPolicy
184178
BackendTLS *BackendTLSPolicy
185-
FrontendTLS *FrontendTLSPolicy
186179
BackendProtocol *BackendProtocol
187180
SSLRedirect *bool
188181
RewriteTarget *string

pkg/i2gw/emitters/agentgateway/README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,25 +287,12 @@ These are mapped into an `AgentgatewayPolicy` using agentgateway’s `Traffic.Ti
287287

288288
#### Frontend TLS Settings
289289

290-
The agentgateway emitter supports projecting frontend TLS listener settings via:
291-
292-
- `nginx.ingress.kubernetes.io/ssl-handshake-timeout`
293-
- `nginx.ingress.kubernetes.io/ssl-alpn`
294-
295-
These are mapped into an `AgentgatewayPolicy` using agentgateway's `Frontend.TLS` model:
296-
297-
- `ssl-handshake-timeout` -> `AgentgatewayPolicy.spec.frontend.tls.handshakeTimeout`
298-
- `ssl-alpn` -> `AgentgatewayPolicy.spec.frontend.tls.alpnProtocols`
290+
Ingress NGINX does not document per-Ingress annotations for the downstream TLS handshake timeout or ALPN protocol
291+
settings exposed by `AgentgatewayPolicy.spec.frontend.tls`.
299292

300293
**Notes:**
301294

302-
- Agentgateway validates `spec.frontend` only on `Gateway` targets, so ingress2gateway emits a single
303-
Gateway-targeted policy named `<gateway>-frontend-tls`.
304-
- If multiple source Ingresses on the same Gateway request different frontend TLS settings, the emitter returns an
305-
error because agentgateway cannot scope these settings to an individual HTTPRoute or listener.
306-
- `ssl-handshake-timeout` accepts either Go-style durations (`20s`, `1m`) or bare seconds (`20`) and must be at least `100ms`.
307-
- `ssl-alpn` is parsed as a comma-separated list and de-duplicated while preserving order.
308-
- If only `ssl-alpn` is set, the provider projects a default `15s` handshake timeout so `spec.frontend.tls` remains valid.
295+
- ingress2gateway does not currently emit additional `frontend.tls` settings for ingress-nginx inputs.
309296

310297
#### Frontend HTTP Settings
311298

pkg/i2gw/emitters/agentgateway/emitter.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ func (e *Emitter) Emit(ir emitterir.EmitterIR) (i2gw.GatewayResources, field.Err
6565
// Track AgentgatewayPolicies per ingress name
6666
agentgatewayPolicies := map[string]*agentgatewayv1alpha1.AgentgatewayPolicy{}
6767

68-
// Track Gateway-scoped frontend TLS policies. Agentgateway validates
69-
// spec.frontend only when the policy targets the Gateway directly.
70-
gatewayFrontendTLSPolicies := map[types.NamespacedName]*agentgatewayv1alpha1.AgentgatewayPolicy{}
71-
gatewayFrontendTLSPolicySources := map[types.NamespacedName]string{}
72-
7368
// Track backend-scoped AgentgatewayPolicies per Service (ns/name) (e.g. TLS, connect timeout)
7469
backendPolicies := map[types.NamespacedName]*agentgatewayv1alpha1.AgentgatewayPolicy{}
7570

@@ -117,18 +112,6 @@ func (e *Emitter) Emit(ir emitterir.EmitterIR) (i2gw.GatewayResources, field.Err
117112
touched = true
118113
}
119114

120-
// Frontend TLS settings are Gateway-scoped in agentgateway.
121-
if _, frontendTLSErr := applyFrontendTLSPolicy(
122-
pol,
123-
polSourceIngressName,
124-
httpRouteContext.HTTPRoute,
125-
httpRouteKey.Namespace,
126-
gatewayFrontendTLSPolicies,
127-
gatewayFrontendTLSPolicySources,
128-
); frontendTLSErr != nil {
129-
errs = append(errs, frontendTLSErr)
130-
}
131-
132115
// Check if SSL redirect is enabled but don't apply it yet (will split route later).
133116
if applySSLRedirectPolicy(pol) {
134117
routesToSplitForSSLRedirect[httpRouteKey] = true
@@ -355,11 +338,6 @@ func (e *Emitter) Emit(ir emitterir.EmitterIR) (i2gw.GatewayResources, field.Err
355338
}
356339
}
357340

358-
// Collect Gateway-scoped frontend TLS policies.
359-
for _, ap := range gatewayFrontendTLSPolicies {
360-
agentgatewayObjs = append(agentgatewayObjs, ap)
361-
}
362-
363341
// Collect AgentgatewayPolicies
364342
for _, ap := range agentgatewayPolicies {
365343
agentgatewayObjs = append(agentgatewayObjs, ap)

pkg/i2gw/emitters/agentgateway/emitter_integration_test.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -311,32 +311,6 @@ func TestAgentgatewayIngressNginxIntegration_Timeouts(t *testing.T) {
311311
}
312312
}
313313

314-
func TestAgentgatewayIngressNginxIntegration_FrontendTLS(t *testing.T) {
315-
t.Helper()
316-
317-
tests := []struct {
318-
name string
319-
inputRel string
320-
goldenRel string
321-
}{
322-
{
323-
name: "frontend_tls",
324-
inputRel: filepath.Join(
325-
"pkg", "i2gw", "emitters", "agentgateway", "testing", "testdata", "input", "frontend_tls.yaml",
326-
),
327-
goldenRel: filepath.Join(
328-
"pkg", "i2gw", "emitters", "agentgateway", "testing", "testdata", "output", "frontend_tls.yaml",
329-
),
330-
},
331-
}
332-
333-
for _, tt := range tests {
334-
t.Run(tt.name, func(t *testing.T) {
335-
runGoldenTest(t, tt.inputRel, tt.goldenRel)
336-
})
337-
}
338-
}
339-
340314
func TestAgentgatewayIngressNginxIntegration_CORS(t *testing.T) {
341315
t.Helper()
342316

pkg/i2gw/emitters/agentgateway/frontend_tls.go

Lines changed: 0 additions & 141 deletions
This file was deleted.

pkg/i2gw/emitters/agentgateway/frontend_tls_test.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)