solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.07k stars 436 forks source link

VirtualHostOptions examples in docs fail because targetRefs are not of list type #9910

Open jameshbarton opened 1 month ago

jameshbarton commented 1 month ago

Version

1.17.x (latest)

Gateway API

Kubernetes Gateway API

Describe the requested changes

Multiple VirtualHostOptions examples in GG docs fail because targetRefs are not list-formatted.

Example:

% kubectl apply -n gloo-system -f- <<EOF
apiVersion: gateway.solo.io/v1
kind: VirtualHostOption
metadata:
  name: header-manipulation
  namespace: gloo-system
spec:
  options:
    headerManipulation:
      requestHeadersToAdd:
        - header:
            key: "my-header"
            value: "gloo-gateway"
  targetRefs:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: http
    namespace: gloo-system
EOF
Error from server (BadRequest): error when creating "STDIN": VirtualHostOption in version "v1" cannot be handled as a VirtualHostOption: strict decoding error: unknown field "spec.targetRefs.group", unknown field "spec.targetRefs.kind", unknown field "spec.targetRefs.name", unknown field "spec.targetRefs.namespace"

Link to any relevant existing docs

https://docs.solo.io/gateway/latest/traffic-management/header-control/response-header/#add-response-headers-route https://docs.solo.io/gateway/latest/traffic-management/header-control/request-header/#add-request-header https://docs.solo.io/gateway/latest/traffic-management/header-control/request-header/#add-request-header-secret

Browser Information

No response

Additional Context

No response

sam-heilbron commented 3 weeks ago

cc @Nadine2016