clusterName returns the xDS cluster name stored in the attributes in the context.
(ctx context.Context)
| 59 | // clusterName returns the xDS cluster name stored in the attributes in the |
| 60 | // context. |
| 61 | func clusterName(ctx context.Context) string { |
| 62 | chi := credentials.ClientHandshakeInfoFromContext(ctx) |
| 63 | if chi.Attributes == nil { |
| 64 | return "" |
| 65 | } |
| 66 | cluster, _ := xds.GetXDSHandshakeClusterName(chi.Attributes) |
| 67 | return cluster |
| 68 | } |
| 69 | |
| 70 | // isDirectPathCluster returns true if the cluster in the context is a |
| 71 | // directpath cluster, meaning ALTS should be used. |
no test coverage detected