Commit Graph

7 Commits

Author SHA1 Message Date
Menghan Li 7408372e0e
xdsrouting: remove env variable for routing (#3754) 2020-07-27 13:55:02 -07:00
Menghan Li ca3959a1b2
xdsrouting: handle route fields in xds_client (#3747) 2020-07-20 14:04:46 -07:00
Menghan Li d071d56834
xds: handle weighted cluster as route action (#3613) 2020-05-26 13:58:04 -07:00
Menghan Li e7557c8282
xds: reject RDS response containing match with case-sensitive false (#3592) 2020-05-04 08:50:03 -07:00
Zou Nengren 6774920a77
xds: Modify return value of getClusterFromRouteConfiguration (#3534) 2020-04-17 11:59:34 -07:00
Menghan Li f9a1aeb4f2
xds: accept either "" or "/" as the prefix for the default route (#3535) 2020-04-15 16:50:46 -07:00
Menghan Li ff40ef4227
xds: refactor xds_client (#3477)
This PR refactors xds_client to support multiples watches. Those watches can be for the same type and same resource_name.

There's upper level `Client` and lower level `v2client`. Before this change, all logic was in `v2client`, and `Client` was a thin wrapper.

This PR moves some of the functionality from `v2client` to `Client`. New layers:

- Upper level `Client`
  - keeps a list of watchers
    - provides method `func WatchXXX() (cancel func())`
    - has `WatchService()` which involves `LDS` and `RDS`
  - handles resources from the xDS responses and dispatch to the watchers
    - including multiple watchers for the same resource_name
  - keeps cache
    - and checks cache for new watches

- Lower level `v2client`
  - is a dumb client that
    - manages ADS stream
    - sends a new xDS request when add/remove watch
    - parses xDS responses
      - It doesn't call watchers, but forwards all parsed results to upper Client
    - handles ACK/NACK
  - supports `addWatch(type, name)` and `removeWatch(type, name)`
    - instead of `func watchCDS() func()`, which is now moved up to upper `Client`

Also includes other changes:
 - Corresponding test changes (some tests for `v2client` were moved to `Client`)
 - Method and type renaming
   - CDS/EDS -> Cluster/Endpoints
 - callback functions all accept updates as non-pointers
2020-04-15 14:32:31 -07:00