Update resolver defaulting
This commit is contained in:
parent
b149185794
commit
56fdae9ace
|
@ -2372,7 +2372,7 @@ func testcase_LBSplitterAndResolver() compileTestCase {
|
||||||
Type: structs.DiscoveryGraphNodeTypeResolver,
|
Type: structs.DiscoveryGraphNodeTypeResolver,
|
||||||
Name: "foo.default.dc1",
|
Name: "foo.default.dc1",
|
||||||
Resolver: &structs.DiscoveryResolver{
|
Resolver: &structs.DiscoveryResolver{
|
||||||
Default: true,
|
Default: false,
|
||||||
ConnectTimeout: 5 * time.Second,
|
ConnectTimeout: 5 * time.Second,
|
||||||
Target: "foo.default.dc1",
|
Target: "foo.default.dc1",
|
||||||
},
|
},
|
||||||
|
@ -2389,7 +2389,7 @@ func testcase_LBSplitterAndResolver() compileTestCase {
|
||||||
Type: structs.DiscoveryGraphNodeTypeResolver,
|
Type: structs.DiscoveryGraphNodeTypeResolver,
|
||||||
Name: "bar.default.dc1",
|
Name: "bar.default.dc1",
|
||||||
Resolver: &structs.DiscoveryResolver{
|
Resolver: &structs.DiscoveryResolver{
|
||||||
Default: true,
|
Default: false,
|
||||||
ConnectTimeout: 5 * time.Second,
|
ConnectTimeout: 5 * time.Second,
|
||||||
Target: "bar.default.dc1",
|
Target: "bar.default.dc1",
|
||||||
},
|
},
|
||||||
|
@ -2411,7 +2411,7 @@ func testcase_LBSplitterAndResolver() compileTestCase {
|
||||||
Type: structs.DiscoveryGraphNodeTypeResolver,
|
Type: structs.DiscoveryGraphNodeTypeResolver,
|
||||||
Name: "baz.default.dc1",
|
Name: "baz.default.dc1",
|
||||||
Resolver: &structs.DiscoveryResolver{
|
Resolver: &structs.DiscoveryResolver{
|
||||||
Default: true,
|
Default: false,
|
||||||
ConnectTimeout: 5 * time.Second,
|
ConnectTimeout: 5 * time.Second,
|
||||||
Target: "baz.default.dc1",
|
Target: "baz.default.dc1",
|
||||||
},
|
},
|
||||||
|
@ -2476,7 +2476,7 @@ func testcase_LBResolver() compileTestCase {
|
||||||
Type: structs.DiscoveryGraphNodeTypeResolver,
|
Type: structs.DiscoveryGraphNodeTypeResolver,
|
||||||
Name: "main.default.dc1",
|
Name: "main.default.dc1",
|
||||||
Resolver: &structs.DiscoveryResolver{
|
Resolver: &structs.DiscoveryResolver{
|
||||||
Default: true,
|
Default: false,
|
||||||
ConnectTimeout: 5 * time.Second,
|
ConnectTimeout: 5 * time.Second,
|
||||||
Target: "main.default.dc1",
|
Target: "main.default.dc1",
|
||||||
},
|
},
|
||||||
|
|
|
@ -730,7 +730,8 @@ func (e *ServiceResolverConfigEntry) IsDefault() bool {
|
||||||
len(e.Subsets) == 0 &&
|
len(e.Subsets) == 0 &&
|
||||||
e.Redirect == nil &&
|
e.Redirect == nil &&
|
||||||
len(e.Failover) == 0 &&
|
len(e.Failover) == 0 &&
|
||||||
e.ConnectTimeout == 0
|
e.ConnectTimeout == 0 &&
|
||||||
|
e.LoadBalancer == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ServiceResolverConfigEntry) GetKind() string {
|
func (e *ServiceResolverConfigEntry) GetKind() string {
|
||||||
|
|
|
@ -82,9 +82,6 @@ func (c *CompiledDiscoveryChain) IsDefault() bool {
|
||||||
if !node.Resolver.Default {
|
if !node.Resolver.Default {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if node.LoadBalancer != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
target := c.Targets[node.Resolver.Target]
|
target := c.Targets[node.Resolver.Target]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue