diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-07-08 16:15:05 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2020-07-10 10:23:19 +0200 |
commit | 0947e1997b493898df773137ac52fc5a50f19716 (patch) | |
tree | 011bbf6a6fc0237100217c1930c72e6a4b238a11 /controller-server | |
parent | 437d046dc3cb3bff64227008a054234fe44ff451 (diff) |
Remove obsolete cleanup of type A records
Diffstat (limited to 'controller-server')
3 files changed, 1 insertions, 12 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 d6f0ff4d85f..523f3533a7f 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 @@ -21,7 +21,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordName; import com.yahoo.vespa.hosted.controller.api.integration.dns.WeightedAliasTarget; import com.yahoo.vespa.hosted.controller.application.Endpoint; import com.yahoo.vespa.hosted.controller.application.EndpointId; -import com.yahoo.vespa.hosted.controller.application.SystemApplication; import com.yahoo.vespa.hosted.controller.dns.NameServiceForwarder; import com.yahoo.vespa.hosted.controller.dns.NameServiceQueue.Priority; import com.yahoo.vespa.hosted.controller.dns.NameServiceRequest; @@ -263,15 +262,7 @@ public class RoutingPolicies { var name = RecordName.from(policy.endpointIn(controller.system(), RoutingMethod.exclusive, controller.zoneRegistry()) .dnsName()); var data = RecordData.fqdn(policy.canonicalName().value()); - NameServiceForwarder forwarder = nameServiceForwarderIn(policy.id().zone()); - if (policy.id().owner().equals(SystemApplication.configServer.id())) { - // TODO(mpolden): Remove this after transition is complete. Before automatic provisioning of config server - // load balancers, the DNS records for the config server LB were of type A. It's not possible - // to change the type of an existing record, we therefore remove the A record before creating - // a CNAME. - forwarder.removeRecords(Record.Type.A, name, Priority.normal); - } - forwarder.createCname(name, data, Priority.normal); + nameServiceForwarderIn(policy.id().zone()).createCname(name, data, Priority.normal); } /** Remove policies and zone DNS records unreferenced by given load balancers */ diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesLegacyTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesLegacyTest.java index 8479309c63b..d5a50d98c8d 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesLegacyTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesLegacyTest.java @@ -586,7 +586,6 @@ public class RoutingPoliciesLegacyTest { var tester = new RoutingPoliciesTester(); var app = SystemApplication.configServer.id(); RecordName name = RecordName.from("cfg.prod.us-west-1.test.vip"); - tester.controllerTester().nameService().add(new Record(Record.Type.A, name, RecordData.from("192.0.2.1"))); tester.provisionLoadBalancers(1, app, zone1); tester.routingPolicies().refresh(app, DeploymentSpec.empty, zone1); 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 7064c6e1362..6679fc112a3 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 @@ -675,7 +675,6 @@ public class RoutingPoliciesTest { var tester = new RoutingPoliciesTester(); var app = SystemApplication.configServer.id(); RecordName name = RecordName.from("cfg.prod.us-west-1.test.vip"); - tester.controllerTester().nameService().add(new Record(Record.Type.A, name, RecordData.from("192.0.2.1"))); tester.provisionLoadBalancers(1, app, zone1); tester.routingPolicies().refresh(app, DeploymentSpec.empty, zone1); |