NET-6097 - sidecar proxy controller - give name to first failover policy target (#19239)

fix-controller-watch
John Murret 1 year ago committed by GitHub
parent 8eb074e7c1
commit 9f4f99c626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -287,7 +287,12 @@ func (b *Builder) buildDestination(
)
clusterName := fmt.Sprintf("%s.%s", portName, sni)
egBase := b.newClusterEndpointGroup("", sni, portName, details.IdentityRefs, connectTimeout, loadBalancer)
egName := ""
if details.FailoverConfig != nil {
egName = fmt.Sprintf("%s%d~%s", xdscommon.FailoverClusterNamePrefix, 0, clusterName)
}
egBase := b.newClusterEndpointGroup(egName, sni, portName, details.IdentityRefs, connectTimeout, loadBalancer)
var endpointGroups []*pbproxystate.EndpointGroup
@ -319,7 +324,10 @@ func (b *Builder) buildDestination(
destDC,
b.trustDomain,
)
destClusterName := fmt.Sprintf("%s%d~%s", xdscommon.FailoverClusterNamePrefix, i, clusterName)
// index 0 was already given to non-fail original
failoverGroupIndex := i + 1
destClusterName := fmt.Sprintf("%s%d~%s", xdscommon.FailoverClusterNamePrefix, failoverGroupIndex, clusterName)
egDest := b.newClusterEndpointGroup(destClusterName, destSNI, destPortName, destDetails.IdentityRefs, destConnectTimeout, destLoadBalancer)

@ -30,7 +30,8 @@
}
}
}
}
},
"name": "failover-target~0~http.api-1.default.dc1.internal.foo.consul"
},
{
"dynamic": {
@ -54,7 +55,7 @@
}
}
},
"name": "failover-target~0~http.api-1.default.dc1.internal.foo.consul"
"name": "failover-target~1~http.api-1.default.dc1.internal.foo.consul"
}
]
},
@ -310,7 +311,7 @@
}
},
"requiredEndpoints": {
"failover-target~0~http.api-1.default.dc1.internal.foo.consul": {
"failover-target~1~http.api-1.default.dc1.internal.foo.consul": {
"id": {
"name": "backup-1",
"tenancy": {

Loading…
Cancel
Save