@@ -345,7 +345,7 @@ func BuildRateLimitDescriptors(rule *traffic_manage.Rule) ([]*route.RateLimit_Ac
345345 Value : arg .GetValue ().GetValue ().GetValue (),
346346 })
347347 case apitraffic .MatchArgument_QUERY :
348- queryParameterValueMatch := BuildRateLimitActionQueryParameterValueMatch (descriptorKey , arg . Value )
348+ queryParameterValueMatch := BuildRateLimitActionQueryParameterValueMatch (descriptorKey , arg )
349349 actions = append (actions , & route.RateLimit_Action {
350350 ActionSpecifier : & route.RateLimit_Action_QueryParameterValueMatch_ {
351351 QueryParameterValueMatch : queryParameterValueMatch ,
@@ -392,22 +392,22 @@ func BuildRateLimitDescriptors(rule *traffic_manage.Rule) ([]*route.RateLimit_Ac
392392}
393393
394394func BuildRateLimitActionQueryParameterValueMatch (key string ,
395- value * apimodel. MatchString ) * route.RateLimit_Action_QueryParameterValueMatch {
395+ arg * apitraffic. MatchArgument ) * route.RateLimit_Action_QueryParameterValueMatch {
396396 queryParameterValueMatch := & route.RateLimit_Action_QueryParameterValueMatch {
397397 DescriptorKey : key ,
398- DescriptorValue : value .GetValue ().GetValue (),
398+ DescriptorValue : arg . GetValue () .GetValue ().GetValue (),
399399 ExpectMatch : wrapperspb .Bool (true ),
400400 QueryParameters : []* route.QueryParameterMatcher {},
401401 }
402- switch value .GetType () {
402+ switch arg . GetValue () .GetType () {
403403 case apimodel .MatchString_EXACT :
404404 queryParameterValueMatch .QueryParameters = []* route.QueryParameterMatcher {
405405 {
406- Name : key ,
406+ Name : arg . GetKey () ,
407407 QueryParameterMatchSpecifier : & route.QueryParameterMatcher_StringMatch {
408408 StringMatch : & v32.StringMatcher {
409409 MatchPattern : & v32.StringMatcher_Exact {
410- Exact : value .GetValue ().GetValue (),
410+ Exact : arg . GetValue () .GetValue ().GetValue (),
411411 },
412412 },
413413 },
@@ -416,13 +416,13 @@ func BuildRateLimitActionQueryParameterValueMatch(key string,
416416 case apimodel .MatchString_REGEX :
417417 queryParameterValueMatch .QueryParameters = []* route.QueryParameterMatcher {
418418 {
419- Name : key ,
419+ Name : arg . GetKey () ,
420420 QueryParameterMatchSpecifier : & route.QueryParameterMatcher_StringMatch {
421421 StringMatch : & v32.StringMatcher {
422422 MatchPattern : & v32.StringMatcher_SafeRegex {
423423 SafeRegex : & v32.RegexMatcher {
424424 EngineType : & v32.RegexMatcher_GoogleRe2 {},
425- Regex : value .GetValue ().GetValue (),
425+ Regex : arg . GetValue () .GetValue ().GetValue (),
426426 },
427427 },
428428 },
0 commit comments