@@ -28,8 +28,7 @@ import (
2828 "github.com/google/go-cmp/cmp"
2929
3030 "google.golang.org/grpc/balancer"
31- _ "google.golang.org/grpc/balancer/grpclb" // grpclb for config parsing.
32- rlspb "google.golang.org/grpc/balancer/rls/internal/proto/grpc_lookup_v1"
31+ _ "google.golang.org/grpc/balancer/grpclb" // grpclb for config parsing.
3332 _ "google.golang.org/grpc/internal/resolver/passthrough" // passthrough resolver.
3433)
3534
@@ -58,7 +57,6 @@ func testEqual(a, b *lbConfig) bool {
5857 a .maxAge == b .maxAge &&
5958 a .staleAge == b .staleAge &&
6059 a .cacheSizeBytes == b .cacheSizeBytes &&
61- a .rpStrategy == b .rpStrategy &&
6260 a .defaultTarget == b .defaultTarget &&
6361 a .cpName == b .cpName &&
6462 a .cpTargetField == b .cpTargetField &&
@@ -91,7 +89,6 @@ func TestParseConfig(t *testing.T) {
9189 "maxAge" : "500s",
9290 "staleAge": "600s",
9391 "cacheSizeBytes": 1000,
94- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
9592 "defaultTarget": "passthrough:///default"
9693 },
9794 "childPolicy": [
@@ -107,7 +104,6 @@ func TestParseConfig(t *testing.T) {
107104 maxAge : 5 * time .Minute , // This is max maxAge.
108105 staleAge : time .Duration (0 ), // StaleAge is ignore because it was higher than maxAge.
109106 cacheSizeBytes : 1000 ,
110- rpStrategy : rlspb .RouteLookupConfig_ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS ,
111107 defaultTarget : "passthrough:///default" ,
112108 cpName : "grpclb" ,
113109 cpTargetField : "service_name" ,
@@ -127,7 +123,6 @@ func TestParseConfig(t *testing.T) {
127123 "maxAge": "60s",
128124 "staleAge" : "50s",
129125 "cacheSizeBytes": 1000,
130- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
131126 "defaultTarget": "passthrough:///default"
132127 },
133128 "childPolicy": [{"grpclb": {"childPolicy": [{"pickfirst": {}}]}}],
@@ -139,7 +134,6 @@ func TestParseConfig(t *testing.T) {
139134 maxAge : 60 * time .Second ,
140135 staleAge : 50 * time .Second ,
141136 cacheSizeBytes : 1000 ,
142- rpStrategy : rlspb .RouteLookupConfig_ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS ,
143137 defaultTarget : "passthrough:///default" ,
144138 cpName : "grpclb" ,
145139 cpTargetField : "service_name" ,
@@ -288,41 +282,6 @@ func TestParseConfigErrors(t *testing.T) {
288282 }` ),
289283 wantErr : "rls: cache_size_bytes must be greater than 0 in service config" ,
290284 },
291- {
292- desc : "invalid request processing strategy" ,
293- input : []byte (`{
294- "routeLookupConfig": {
295- "grpcKeybuilders": [{
296- "names": [{"service": "service", "method": "method"}],
297- "headers": [{"key": "k1", "names": ["v1"]}]
298- }],
299- "lookupService": "passthrough:///target",
300- "lookupServiceTimeout" : "10s",
301- "maxAge": "30s",
302- "staleAge" : "25s",
303- "cacheSizeBytes": 1000
304- }
305- }` ),
306- wantErr : "rls: request_processing_strategy cannot be left unspecified in service config" ,
307- },
308- {
309- desc : "request processing strategy without default target" ,
310- input : []byte (`{
311- "routeLookupConfig": {
312- "grpcKeybuilders": [{
313- "names": [{"service": "service", "method": "method"}],
314- "headers": [{"key": "k1", "names": ["v1"]}]
315- }],
316- "lookupService": "passthrough:///target",
317- "lookupServiceTimeout" : "10s",
318- "maxAge": "30s",
319- "staleAge" : "25s",
320- "cacheSizeBytes": 1000,
321- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS"
322- }
323- }` ),
324- wantErr : "default_target is not set" ,
325- },
326285 {
327286 desc : "no child policy" ,
328287 input : []byte (`{
@@ -336,7 +295,6 @@ func TestParseConfigErrors(t *testing.T) {
336295 "maxAge": "30s",
337296 "staleAge" : "25s",
338297 "cacheSizeBytes": 1000,
339- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
340298 "defaultTarget": "passthrough:///default"
341299 }
342300 }` ),
@@ -355,7 +313,6 @@ func TestParseConfigErrors(t *testing.T) {
355313 "maxAge": "30s",
356314 "staleAge" : "25s",
357315 "cacheSizeBytes": 1000,
358- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
359316 "defaultTarget": "passthrough:///default"
360317 },
361318 "childPolicy": [
@@ -378,7 +335,6 @@ func TestParseConfigErrors(t *testing.T) {
378335 "maxAge": "30s",
379336 "staleAge" : "25s",
380337 "cacheSizeBytes": 1000,
381- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
382338 "defaultTarget": "passthrough:///default"
383339 },
384340 "childPolicy": [
@@ -402,7 +358,6 @@ func TestParseConfigErrors(t *testing.T) {
402358 "maxAge": "30s",
403359 "staleAge" : "25s",
404360 "cacheSizeBytes": 1000,
405- "request_processing_strategy": "ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS",
406361 "defaultTarget": "passthrough:///default"
407362 },
408363 "childPolicy": [
0 commit comments