Use a full EndpointRef on ComputedRoutes targets instead of just the ID
* Use a full EndpointRef on ComputedRoutes targets instead of just the ID Today, the `ComputedRoutes` targets have the appropriate ID set for their `ServiceEndpoints` reference; however, the `MeshPort` and `RoutePort` are assumed to be that of the target when adding the endpoints reference in the sidecar's `ProxyStateTemplate`. This is problematic when the target lives behind a `MeshGateway` and the `Mesh/RoutePort` used in the sidecar's `ProxyStateTemplate` should be that of the `MeshGateway` instead of the target. Instead of assuming the `MeshPort` and `RoutePort` when building the `ProxyStateTemplate` for the sidecar, let's just add the full `EndpointRef` -- including the ID and the ports -- when hydrating the computed destinations. * Make sure the UID from the existing ServiceEndpoints makes it onto ComputedRoutes * Update test assertions * Undo confusing whitespace change * Remove one-line function wrapper * Use plural name for endpoints ref * Add constants for gateway name, kind and port names
Showing
- internal/mesh/internal/controllers/gatewayproxy/builder/builder_test.go 4 additions, 3 deletions...internal/controllers/gatewayproxy/builder/builder_test.go
- internal/mesh/internal/controllers/meshgateways/controller.go 8 additions, 7 deletions...rnal/mesh/internal/controllers/meshgateways/controller.go
- internal/mesh/internal/controllers/sidecarproxy/builder/destination_multiport_test.go 6 additions, 1 deletion...ollers/sidecarproxy/builder/destination_multiport_test.go
- internal/mesh/internal/controllers/sidecarproxy/builder/destinations.go 2 additions, 13 deletions...internal/controllers/sidecarproxy/builder/destinations.go
- internal/mesh/internal/controllers/sidecarproxy/builder/destinations_test.go 61 additions, 12 deletions...nal/controllers/sidecarproxy/builder/destinations_test.go
- internal/mesh/internal/controllers/sidecarproxy/fetcher/data_fetcher.go 32 additions, 13 deletions...internal/controllers/sidecarproxy/fetcher/data_fetcher.go
- internal/mesh/internal/controllers/sidecarproxy/fetcher/data_fetcher_test.go 36 additions, 7 deletions...nal/controllers/sidecarproxy/fetcher/data_fetcher_test.go
- internal/mesh/internal/types/computed_routes.go 2 additions, 2 deletionsinternal/mesh/internal/types/computed_routes.go
- internal/mesh/internal/types/computed_routes_test.go 6 additions, 5 deletionsinternal/mesh/internal/types/computed_routes_test.go
- proto-public/pbmesh/v2beta1/computed_routes.pb.go 256 additions, 251 deletionsproto-public/pbmesh/v2beta1/computed_routes.pb.go
- proto-public/pbmesh/v2beta1/computed_routes.proto 3 additions, 3 deletionsproto-public/pbmesh/v2beta1/computed_routes.proto
Please register or sign in to comment