【问题标题】:Istio queryParams always returning truthyIstio queryParams 总是返回真值
【发布时间】:2019-08-28 02:50:02
【问题描述】:

设置 istio 和基本的 bookinfo 应用

这样设置虚拟服务: 一个带标题的:

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: ~

另一个使用 queryParams 作为路由区分器:

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: ~

出于某种原因,标头策略似乎运行良好。即如果我不提交header=test,istio 将返回 404。

但是,对于 queryParams,它总是返回 thruthy。难道我做错了什么?或者这是一个与 istio 相关的问题。

(注意:这 2 个 vs 不是并行运行的,而是从一个更新到另一个的更新,因此拥有 2 个相似的 VS 不会有点奇怪)

理想情况下,我希望 queryParam 与标头的行为相同。

【问题讨论】:

  • 我认为您需要编辑第二部分,因为没有显示queryParams

标签: istio


【解决方案1】:

这实际上是一个准缺陷。

istio-1.2 的文档错误地说明了 1.3 中发现的功能。

对于那些有类似情况的人,升级到 istio 1.3.x 应该可以解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多