Open garfieldnate opened 4 years ago
Same issue here. I just tried with prefix
instead of exact
and ended up with PrefixMatch: ["value length must be at least " '\x01' " bytes"])
in the log. Changed it to exact
and it seems to work as intended.
I had some success with this format:
- match:
- headers:
my-header: {}
The documentation in question is here: https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPMatchRequest
Reading this, we thought the YAML file should contain no value for the header name entry itself, like so:
The key is
my-header
and the value is NULL. We could also have put in~
to get the same result. However,istioctl
did not like this:There are plenty of YAML parsers out there that can't handle NULL map values, so the next thing we tried was an empty string:
However, this lead to another error:
Our current guess is that the following is correct:
However, reading this is confusing because it looks like a rule that matches when
my-header
is present and the value is exactly the empty string.The documentation needs to be updated to clarify the correct structure for matching on the presence of headers. I will gladly update the English documentation for this, but first I need confirmation on exactly what YAML structure to use in this case.