Istio queryParams always returning truthy

久未见 提交于 2021-01-29 09:41:22

问题


Set up istio and the basic bookinfo app

set up the virtual service as such: one with headers:

kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: bookinfo
spec:
  hosts:
    - '*'
  gateways:
    - bookinfo-gateway
  http:
    - match:
        - headers:
            apiKey:
              exact: test
      rewrite:
        uri: /productpage
      route:
        - destination:
            host: productpage
            port:
              number: 9080
  tcp: ~
  tls: ~

and another with queryParams as the routing differentiator:

kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: bookinfo
spec:
  hosts:
    - '*'
  gateways:
    - bookinfo-gateway
  http:
    - match:
        - headers:
            apiKey:
              exact: test
      rewrite:
        uri: /productpage
      route:
        - destination:
            host: productpage
            port:
              number: 9080
  tcp: ~
  tls: ~

For some reason, the header policy seems to work fine. i.e if I dont submit the header=test, istio will return 404.

HOWEVER, for the queryParams, it is always returning thruthy. am I doing something wrong? or is this an istio related issue at its core.

(note: these 2 vs are not running in parallel, but rather an update from one to another, so it cant be some wonkyness with having 2 similar VS)

Ideally i would expect for the queryParam vs headers to act the same.


回答1:


This was in fact a quasi-defect.

The docs for istio-1.2 was incorrectly stating feature that was found in 1.3.

For those of you in a similar situation, upgrading to istio 1.3.x should resolve it.



来源:https://stackoverflow.com/questions/57496077/istio-queryparams-always-returning-truthy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!