envoyproxy / gateway

Manages Envoy Proxy as a Standalone or Kubernetes-based Application Gateway
https://gateway.envoyproxy.io
Apache License 2.0
1.62k stars 350 forks source link

earlyRequestHeaders not accepted #4672

Open gid-fieldcode opened 6 days ago

gid-fieldcode commented 6 days ago

Seeing the new feature with the earlyRequestHeaders, we found that it's essential for us so we upgraded to 1.2.1. We used helm upgrade --install envoy-gateway oci://docker.io/envoyproxy/gateway-helm --version v1.2.1 -n envoy-gateway

So now we have defined this resource, using syntax from the documentation page:

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
  name: enable-early-headers
  namespace: test
spec:
  targetRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: apps
  headers:
    earlyRequestHeaders:
      add:
        - name: "x-header-erp"
          value: "foobar"

...and when we apply it we get this error:

ClientTrafficPolicy in version "v1alpha1" cannot be handled as a ClientTrafficPolicy: strict decoding error: unknown field "spec.headers.earlyRequestHeaders"

What could we be missing here?

arkodg commented 6 days ago

hey @gid-fieldcode, if you used helm to upgrade, the CRDs didn't get updated (https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations), you'll need to manually update the CRDs, steps are here https://gateway.envoyproxy.io/docs/install/install-yaml/#upgrading-from-v11