sdk changes to retrieve upstrem#2577
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds ChangesUpstream routing policy support
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // These are valid at the header phase because routing decisions do not require | ||
| // the request body to be available. | ||
| UpstreamName *string // route to a named upstream definition (nil = no change) | ||
| UpstreamSlot *UpstreamSlot // route to the API's main or sandbox upstream slot instead of the slot implied by the current vhost (nil = no change); requesting a slot the API doesn't have configured is a no-op (logged, not an error) |
There was a problem hiding this comment.
This is not required right?
| // URL. This is the shared wire shape used on both sides of the xDS route-config | ||
| // channel between gateway-controller and policy-engine. | ||
| type UpstreamInfo struct { | ||
| ClusterName string `json:"cluster_name" yaml:"cluster_name"` |
There was a problem hiding this comment.
ClusterName is an internal thing. Why do we need to expose it?
| // ToMap converts UpstreamInfo into a structpb-compatible map for embedding as a | ||
| // nested object in xDS route-config metadata (structpb.Struct only accepts | ||
| // string/bool/number/nil/slice/map values, not arbitrary structs). | ||
| func (u UpstreamInfo) ToMap() map[string]interface{} { |
There was a problem hiding this comment.
Why do we need this func?
|
|
||
| // UpstreamInfoFromMap decodes an UpstreamInfo from the generic map produced when | ||
| // the xDS metadata struct is unmarshalled back to JSON on the consumer side. | ||
| func UpstreamInfoFromMap(m map[string]interface{}) UpstreamInfo { |
sdk changes to retrieve upstrem