Use cloud account of stored LB when checking for DNS challenges
@@ -374,10 +374,14 @@ public class RoutingPolicies {
}
private void setPrivateDns(Endpoint endpoint, LoadBalancerAllocation allocation) {
+ allocation.loadBalancers.stream()
+ .filter(lb -> lb.service().isPresent())
+ .findFirst()
+ .flatMap(lbWithPrivateService ->
controller.serviceRegistry().vpcEndpointService()
.setPrivateDns(DomainName.of(endpoint.dnsName()),
new ClusterId(allocation.deployment, endpoint.cluster()),
- controller.applications().decideCloudAccountOf(allocation.deployment, allocation.deploymentSpec))
+ lbWithPrivateService.cloudAccount()))
.ifPresent(challenge -> {
try {
nameServiceForwarderIn(allocation.deployment.zoneId()).createTxt(challenge.name(), List.of(challenge.data()), Priority.high);
