Kuadrant / kuadrantctl

Kuadrant configuration command line utility
Apache License 2.0
6 stars 13 forks source link

generate virtualservice: path match type flag #41

Closed eguzki closed 2 years ago

eguzki commented 2 years ago

By default, the command kuadrantctl generate istio virtualservice generates Istio VirtualService object with path match type exact.

http:
    - name: getCat
      match:
        - uri:
            exact: /cat
          method:
            exact: GET

OAS 3.X does not explicitly specify it, so this PR adds a command flag to support a new path match type: prefix. With the command line option --path-prefix-match

kuadrantctl generate istio virtualservice --path-prefix-match

The VirtualService will be generated for path match type prefix.

http:
    - name: getDog
      match:
        - uri:
            prefix: /dog
          method:
            exact: GET

This behavior modifies all the operations read from the OAS. If the path match type needs to be specified per OAS operaton, it is best to explore OAS extensions.

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@5aef2d2). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #41   +/-   ##
=======================================
  Coverage        ?   23.56%           
=======================================
  Files           ?       19           
  Lines           ?     1031           
  Branches        ?        0           
=======================================
  Hits            ?      243           
  Misses          ?      742           
  Partials        ?       46           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5aef2d2...a2418ef. Read the comment docs.

eguzki commented 2 years ago

No review in 7 days... applying automerge if nobody reviews in 7 days well known merge policy