Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Canary new annotation #2

Closed
wants to merge 2 commits into from
Closed

Canary new annotation #2

wants to merge 2 commits into from

Conversation

minherz
Copy link
Owner

@minherz minherz commented Jan 11, 2019

Replace existing multiple canary annotations with a single one: canary-by-predicate. The annotation's value is a simple YAML expression that defines a header, a cookie and a weight to be used for routing to an alternative backend like this:

header:
  name: "<http header name>"
  values:
    - "first possible header value"
    - "second possible header value>"
cookie:
  name:"<cookie name>"
  values:
    - "first possible cookie value"
    - "second possible value>"
weight: <integer value in [0..100]>

The following logic is implemented after parsing and publishing traffic policy:
given all (header, cookie and weight) are defined and header and cookie have multiple values
if header is sent in http request and its value matches ANY of the defined header values
or cookie is sent in http request and its value matches ANY of the defined cookie values
or weight functions <= defined weight
then
route request to alternative backend
end

create canary-by-policy annotation with YAML value
remove all other canary* annotations and their parsing
change unit tests for canary parsing
@minherz
Copy link
Owner Author

minherz commented Jan 28, 2019

the work is postponed. the way definitions are delivered isn't good for use with annotations.

@minherz minherz closed this Jan 28, 2019
@minherz minherz deleted the canary_new_annotation branch February 2, 2019 10:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant