Skip to content

Unable to patch out fields using mergeType in BackendTrafficPolicy #6775

@ahinh43

Description

@ahinh43

Description:
When using mergeType in a BackendTrafficPolicy to merge an HTTPRoute BackendTrafficPolicy object to a policy that is attached to a Gateway object there doesn't seem to be any way to patch out a field that is set on the parent BackendTrafficPolicy with the child policy.

For example if I create the following YAML blocks:

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: foo-gateway-wide-policy
  namespace: kube-system
spec:
  compression:
  - type: Gzip
  targetRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: foo-gateway
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: bar-public
  namespace: bar-service
spec:
  hostnames:
  - bar.foo
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: foo-gateway
    namespace: kube-system
    sectionName: https
  rules:
  # ... rules ... #
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: bar-backendpolicy
  namespace: bar-service
spec:
  compression: []
  mergeType: StrategicMerge # can also be JSONMerge
  targetRefs:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute
      name: bar-public

Expected behavior:

Traffic going through the bar.foo httproute should not have compression enabled, per the bar-backendpolicy BackendTrafficPolicy specs.

Actual behavior:

Traffic going through the bar.foo httproute has compression enabled as set by the foo-gateway-wide-policy BackendTrafficPolicy specs.

Relates to #6143

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions