From b8ed82b808b3b2218cdce6775350287dbc32be37 Mon Sep 17 00:00:00 2001 From: freddygv Date: Mon, 12 Apr 2021 10:17:52 -0600 Subject: [PATCH] Fixup bexpr filtering --- agent/structs/structs_filtering_test.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/agent/structs/structs_filtering_test.go b/agent/structs/structs_filtering_test.go index 2fa419eeb3..eb61b5bfb2 100644 --- a/agent/structs/structs_filtering_test.go +++ b/agent/structs/structs_filtering_test.go @@ -95,6 +95,14 @@ var expectedFieldConfigMeshGatewayConfig bexpr.FieldConfigurations = bexpr.Field }, } +var expectedFieldConfigTransparentProxyConfig bexpr.FieldConfigurations = bexpr.FieldConfigurations{ + "OutboundListenerPort": &bexpr.FieldConfiguration{ + StructFieldName: "OutboundListenerPort", + CoerceFn: bexpr.CoerceInt, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, + }, +} + var expectedFieldConfigExposeConfig bexpr.FieldConfigurations = bexpr.FieldConfigurations{ "Checks": &bexpr.FieldConfiguration{ StructFieldName: "Checks", @@ -208,9 +216,13 @@ var expectedFieldConfigConnectProxyConfig bexpr.FieldConfigurations = bexpr.Fiel SubFields: expectedFieldConfigExposeConfig, }, "TransparentProxy": &bexpr.FieldConfiguration{ - StructFieldName: "TransparentProxy", - CoerceFn: bexpr.CoerceBool, - SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, + StructFieldName: "TransparentProxy", + SubFields: expectedFieldConfigTransparentProxyConfig, + }, + "Mode": &bexpr.FieldConfiguration{ + StructFieldName: "Mode", + CoerceFn: bexpr.CoerceString, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches}, }, }