pismo-foss / istiops

Istio's Traffic Manager
42 stars 5 forks source link

Feat/canary regexp support #28

Closed vsantos closed 5 years ago

vsantos commented 5 years ago

We current have only one option for canary releases, setting a header's key:value with it's literal value but sometimes there is a need of getting key:$REGULAR_EXPRESSION instead. To attend this request this PR adds support to canary releases using regexp for it's value passing a flag --regexp.

Ex:

istiops traffic shift \
    -b 5 \
    -d api-mocked:8000 \
    -l app=api-mocked \
    -H 'blau=18534126|123|1023192' \
    -p version=1.1.1-n mock \
    --regexp

In this example a new rule will be set and if request' header value for blau is 18534126 or 123 or 1023192 it will be forwarded to -p version=1.1.1

The default value is --exact.