aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-01-18 13:46:55 +0100
committerjonmv <venstad@gmail.com>2023-01-18 13:46:55 +0100
commit81a775d985a1aa64b01f29511049542368f47728 (patch)
tree5f4ff893f70189c787af433f6825a6ef5a362cd8 /controller-server/src
parent0cb625f5fd5f94b4b8025a9d4f9b546c7ec94d41 (diff)
Remove DNS challenge TXT records after verified
Diffstat (limited to 'controller-server/src')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java18
2 files changed, 10 insertions, 10 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
index fe55f018655..03db932dbb3 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
@@ -17,6 +17,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.dns.AliasTarget;
import com.yahoo.vespa.hosted.controller.api.integration.dns.DirectTarget;
import com.yahoo.vespa.hosted.controller.api.integration.dns.LatencyAliasTarget;
import com.yahoo.vespa.hosted.controller.api.integration.dns.Record;
+import com.yahoo.vespa.hosted.controller.api.integration.dns.Record.Type;
import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordData;
import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordName;
import com.yahoo.vespa.hosted.controller.api.integration.dns.WeightedAliasTarget;
@@ -391,6 +392,7 @@ public class RoutingPolicies {
if (controller.curator().readNameServiceQueue().requests().stream()
.noneMatch(request -> request.name().equals(Optional.of(challenge.name())))) {
challenge.trigger().run();
+ nameServiceForwarderIn(allocation.deployment.zoneId()).removeRecords(Type.TXT, challenge.name(), Priority.normal);
return;
}
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
index 18f685452f2..b553c8eb4c9 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
@@ -537,18 +537,16 @@ public class RoutingPoliciesTest {
app.deploy();
done.set(true);
+ assertEquals(Map.of( RecordName.from("challenge--a.t.aws-us-east-1a.vespa.oath.cloud"),
+ RecordData.from("system"),
+ RecordName.from("challenge--a.t.us-east-1.test.vespa.oath.cloud"),
+ RecordData.from("system"),
+ RecordName.from("challenge--a.t.us-east-3.staging.vespa.oath.cloud"),
+ RecordData.from("system")),
+ challenges);
assertEquals(Set.of(new Record(Type.CNAME,
RecordName.from("a.t.aws-us-east-1a.vespa.oath.cloud"),
- RecordData.from("lb-0--t.a.default--prod.aws-us-east-1a.")),
- new Record(Type.TXT,
- RecordName.from("challenge--a.t.aws-us-east-1a.vespa.oath.cloud"),
- RecordData.from("system")),
- new Record(Type.TXT,
- RecordName.from("challenge--a.t.us-east-1.test.vespa.oath.cloud"),
- RecordData.from("system")),
- new Record(Type.TXT,
- RecordName.from("challenge--a.t.us-east-3.staging.vespa.oath.cloud"),
- RecordData.from("system"))),
+ RecordData.from("lb-0--t.a.default--prod.aws-us-east-1a."))),
tester.controllerTester().nameService().records());
}