Skip to content

HTTPRoute/SecurityPolicy/ListenerSet - StategicMerge setup does not resolve to parent policy #9409

Open

Description

@johnvox

Description:
I want to customize HttpRoute with parentRef setup to ListenerSet
However processSecurityPolicyForRoute does not handle ListenerSet kind properly and ignore gw policy

func (t *Translator) processSecurityPolicyForRoute(

Repro steps:

---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
  name: oidc
spec:
  targetRefs:
    - group: gateway.networking.k8s.io
      kind: Gateway
      name: srm-gateway
  oidc:
    provider:
      issuer: https://login.microsoftonline.com/-/v2.0
    clientID: -
    clientSecret:
      name: envoy-client-secret
    forwardAccessToken: false
    redirectURL: https://kube/oauth2/callback
    cookieDomain: kube
    cookieNames:
      accessToken: EnvoyAccessToken
      idToken: EnvoyIdToken
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
  name: open-argocd
  namespace: argocd
spec:
  mergeType: StrategicMerge
  targetRefs:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute
      name: argocd
  authorization:
    defaultAction: Deny
    rules:
      - name: "allow-jwt-claim"
        action: Allow
        principal:
          jwt:
            provider: entra
            claims:
              - name: roles
                valueType: "StringArray"
                values:
                  - "default"
  jwt:
    providers:
      - name: entra
        issuer: https://login.microsoftonline.com/-/v2.0
        remoteJWKS:
          uri: https://login.microsoftonline.com/-/discovery/v2.0/keys
        extractFrom:
          cookies:
            - EnvoyAccessToken
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: argocd
  namespace: argocd
spec:
  parentRefs:
    - name: argocd
      namespace: argocd
      kind: ListenerSet
  hostnames:
    - argocd.kube
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: fleet-argocd-server
          port: 80

Activity

  1. EmileGoto commented on Jul 2, 2026

    @EmileGoto

    Same issue occurs with BackendTrafficPolicy in processBackendTrafficPolicyForRoute — when mergeType: StrategicMerge is set and the HTTPRoute has a parentRef pointing to a ListenerSet, the policy is silently ignored and the route is dropped from xDS with no status entry set.

  2. added 3 commits that reference this issue on Jul 2, 2026
    8ec1954
    0e8b2e2
  3. EmileGoto commented on Jul 3, 2026

    @EmileGoto

    The fix for SecurityPolicy is merged, and a similar fix will be applied to the other policies: #9243 (comment)

  4. EmileGoto commented on Jul 8, 2026

    @EmileGoto

    Related PRs:

    BTP: #9419
    EEP: #9425

  5. github-actions commented on Aug 8, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had activity in the last 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions