From a78a891d56ac550fc4d1d35569dada5dc67be78c Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Tue, 4 May 2021 18:30:48 -0700 Subject: [PATCH] Fixup filtering tests Missed annotations for SocketPath, LocalSocketPath, LocalServiceSocketPath Signed-off-by: Mark Anderson --- agent/structs/structs_filtering_test.go | 19 +++++++++++++++++-- api/agent.go | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/agent/structs/structs_filtering_test.go b/agent/structs/structs_filtering_test.go index e8ddd9e56..be462e178 100644 --- a/agent/structs/structs_filtering_test.go +++ b/agent/structs/structs_filtering_test.go @@ -183,8 +183,8 @@ var expectedFieldConfigUpstreams bexpr.FieldConfigurations = bexpr.FieldConfigur }, "LocalBindSocketMode": &bexpr.FieldConfiguration{ StructFieldName: "LocalBindSocketMode", - CoerceFn: bexpr.CoerceInt, - SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, + CoerceFn: bexpr.CoerceString, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches}, }, "MeshGateway": &bexpr.FieldConfiguration{ StructFieldName: "MeshGateway", @@ -213,6 +213,11 @@ var expectedFieldConfigConnectProxyConfig bexpr.FieldConfigurations = bexpr.Fiel CoerceFn: bexpr.CoerceInt, SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, }, + "LocalServiceSocketPath": &bexpr.FieldConfiguration{ + StructFieldName: "LocalServiceSocketPath", + CoerceFn: bexpr.CoerceString, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches}, + }, "Upstreams": &bexpr.FieldConfiguration{ StructFieldName: "Upstreams", SupportedOperations: []bexpr.MatchOperator{bexpr.MatchIsEmpty, bexpr.MatchIsNotEmpty}, @@ -366,6 +371,11 @@ var expectedFieldConfigNodeService bexpr.FieldConfigurations = bexpr.FieldConfig CoerceFn: bexpr.CoerceInt, SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, }, + "SocketPath": &bexpr.FieldConfiguration{ + StructFieldName: "SocketPath", + CoerceFn: bexpr.CoerceString, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches}, + }, "Weights": &bexpr.FieldConfiguration{ StructFieldName: "Weights", SubFields: expectedFieldConfigWeights, @@ -460,6 +470,11 @@ var expectedFieldConfigServiceNode bexpr.FieldConfigurations = bexpr.FieldConfig CoerceFn: bexpr.CoerceInt, SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual}, }, + "ServiceSocketPath": &bexpr.FieldConfiguration{ + StructFieldName: "ServiceSocketPath", + CoerceFn: bexpr.CoerceString, + SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches}, + }, "ServiceWeights": &bexpr.FieldConfiguration{ StructFieldName: "ServiceWeights", SubFields: expectedFieldConfigWeights, diff --git a/api/agent.go b/api/agent.go index 8dfdf593f..540ba0167 100644 --- a/api/agent.go +++ b/api/agent.go @@ -82,6 +82,7 @@ type AgentService struct { Meta map[string]string Port int Address string + SocketPath string TaggedAddresses map[string]ServiceAddress `json:",omitempty"` Weights AgentWeights EnableTagOverride bool