Browse Source

Fixup filtering tests

Missed annotations for SocketPath, LocalSocketPath, LocalServiceSocketPath

Signed-off-by: Mark Anderson <manderson@hashicorp.com>
pull/10185/head
Mark Anderson 4 years ago
parent
commit
4d0346bc46
  1. 19
      agent/structs/structs_filtering_test.go
  2. 1
      api/agent.go

19
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,

1
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

Loading…
Cancel
Save