istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/testdata/virtualservice_overlappingmatches.yaml (about)

     1  apiVersion: networking.istio.io/v1alpha3
     2  kind: VirtualService
     3  metadata:
     4    name: non-method-get
     5  spec:
     6    hosts:
     7    - sample.baz.svc.cluster.local
     8    http:
     9    - name: "send product to sample.foo"
    10      match:
    11      - uri:
    12          prefix: "/api/v1/product"
    13      - uri:
    14          prefix: "/api/v1/products"
    15        method:
    16          exact: GET
    17      route:
    18      - destination:
    19          host: sample.foo.svc.cluster.local
    20  ---
    21  apiVersion: networking.istio.io/v1alpha3
    22  kind: VirtualService
    23  metadata:
    24    name: uri-with-prefix-exact 
    25  spec:
    26    hosts:
    27    - sample.baz.svc.cluster.local
    28    http:
    29    - name: "send product to sample.foo"
    30      match:
    31      - uri:
    32          prefix: "/"
    33      - uri:
    34          exact: "/"
    35        method:
    36          exact: GET
    37      route:
    38      - destination:
    39          host: sample.foo.svc.cluster.local
    40  ---
    41  apiVersion: networking.istio.io/v1alpha3
    42  kind: VirtualService
    43  metadata:
    44    name: overlapping-in-single-match
    45  spec:
    46    hosts:
    47    - sample.baz.svc.cluster.local
    48    http:
    49    - name: "send product to sample.foo"
    50      match:
    51      - uri:
    52          prefix: "/api/v1/product"
    53        method:
    54          exact: GET
    55      - uri:
    56          prefix: "/api/v1/products"
    57        method:
    58          exact: GET
    59      route:
    60      - destination:
    61          host: sample.foo.svc.cluster.local
    62  ---
    63  apiVersion: networking.istio.io/v1alpha3
    64  kind: VirtualService
    65  metadata:
    66    name: overlapping-in-two-matches
    67  spec:
    68    hosts:
    69    - sample.baz.svc.cluster.local
    70    http:
    71    - name: "send product to sample.foo"
    72      match:
    73      - uri:
    74          prefix: "/api/v1/product"
    75        method:
    76          exact: GET
    77      route:
    78      - destination:
    79          host: sample.foo.svc.cluster.local
    80    - name: "send products to sample.bar"
    81      match:
    82      - uri:
    83          prefix: "/api/v1/products"
    84        method:
    85          exact: GET
    86      route:
    87      - destination:
    88          host: sample.bar.svc.cluster.local
    89          subset: v1
    90  ---
    91  apiVersion: networking.istio.io/v1alpha3
    92  kind: VirtualService
    93  metadata:
    94    name: overlapping-mathes-with-different-methods
    95  spec:
    96    hosts:
    97    - sample.baz.svc.cluster.local
    98    http:
    99    - name: "send product to sample.foo"
   100      match:
   101      - uri:
   102          prefix: "/api/v1/prod"
   103        method:
   104          exact: GET
   105      route:
   106      - destination:
   107          host: sample.foo.svc.cluster.local
   108    - name: "send products to sample.bar"
   109      match:
   110      - uri:
   111          prefix: "/api/v1/product"
   112        method:
   113          exact: GET
   114      - uri:
   115          prefix: "/api/v1/products"
   116        method:
   117          exact: POST
   118      route:
   119      - destination:
   120          host: sample.bar.svc.cluster.local
   121          subset: v1