mirror of https://github.com/hashicorp/consul
default `ProxyType` for prop override extension
parent
131d234bda
commit
1adc48734d
|
@ -261,6 +261,9 @@ func (p *propertyOverride) validate() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.ProxyType == "" {
|
||||||
|
p.ProxyType = api.ServiceKindConnectProxy
|
||||||
|
}
|
||||||
if err := validProxyTypes.CheckRequired(string(p.ProxyType), "ProxyType"); err != nil {
|
if err := validProxyTypes.CheckRequired(string(p.ProxyType), "ProxyType"); err != nil {
|
||||||
resultErr = multierror.Append(resultErr, err)
|
resultErr = multierror.Append(resultErr, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,7 @@ func TestConstructor(t *testing.T) {
|
||||||
// enforces expected behavior until we do. Multi-member slices should be unaffected
|
// enforces expected behavior until we do. Multi-member slices should be unaffected
|
||||||
// by WeakDecode as it is a more-permissive version of the default behavior.
|
// by WeakDecode as it is a more-permissive version of the default behavior.
|
||||||
"single value Patches decoded as map construction succeeds": {
|
"single value Patches decoded as map construction succeeds": {
|
||||||
arguments: makeArguments(map[string]any{"Patches": makePatch(map[string]any{})}),
|
arguments: makeArguments(map[string]any{"Patches": makePatch(map[string]any{}), "ProxyType": nil}),
|
||||||
expected: validTestCase(OpAdd, extensioncommon.TrafficDirectionOutbound, ResourceTypeRoute).expected,
|
expected: validTestCase(OpAdd, extensioncommon.TrafficDirectionOutbound, ResourceTypeRoute).expected,
|
||||||
ok: true,
|
ok: true,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue