envoyproxy / xds-relay

Caching, aggregation, and relaying for xDS compliant clients and origin servers
Apache License 2.0
132 stars 29 forks source link

Node metadata matcher #154

Closed eapolinario closed 4 years ago

eapolinario commented 4 years ago

This PR adds a matcher for node metadata fields. This is for https://github.com/envoyproxy/xds-relay/issues/125.

Similarly to https://github.com/envoyproxy/xds-relay/pull/137, we encode the node metadata information required in the aggregation rules in a pair of protos: (1) NodeMetadataMatch, and (2) NodeMetadataAction, the former related to the matching process, whereas the latter has to do with the formation of the fragment.

Envoy's node metadata is an opaque struct of type google.protobuf.Struct, which basically represents a dictionary of strings to Value.

This PR adds support for 3 of the 6 values: string, bool, and a nested struct of Value. The support for these other types is going to be added in separate PRs.