-
Notifications
You must be signed in to change notification settings - Fork 553
Description
I was trying to use multiple listens with Go lang XDS client. According to the go documentation, gRPC client must be tolerant of servers that may ignore the resource name in the request. I wasn't able to make that work and while debugging, I found that the code is expecting clients to send all resources names in the request. The relevant code for that check is
go-control-plane/pkg/cache/v2/simple.go
Line 167 in 9821e2b
| if _, exists := names[resourceName]; !exists { |
According to the Go doc, the resource name is the server name hence it is not possible to send all resources in the request.
From Go doc -
The gRPC client will typically start by sending an LDS request for a Listener resource whose name matches the server name from the target URI used to create the gRPC channel (including port suffix if present).
I modified the code as below and it worked as expected. I am open to submit a PR, let me know.
func superset(names map[string]bool, resources map[string]types.Resource) error {
for resourceName := range resources {
if _, exists := names[resourceName]; exists {
return nil
}
}
return fmt.Error("resource is not listed)
}