Skip to content

Validation for HTTPRoute header name is validating header value #10118

@itaysk

Description

@itaysk

Describe the bug
Validation for HTTPRoute's AppendRequestHeaders and AppendResponseHeaders is wrong. It validates the header value instead of the name.
I'll send a PR soon to fix this.

Expected behavior
Validating a Header map will make sure the header name is not empty.

Steps to reproduce the bug
istioctl validate fails this model:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
  - reviews.prod.svc.cluster.local
  http:
  - route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v1
    appendRequestHeaders:
      "name": ""

While this one succeed:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
  - reviews.prod.svc.cluster.local
  http:
  - route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v1
    appendRequestHeaders:
      "": "value"

Version
on master, commit: dce4554

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions