diff --git a/api/v1beta1/conditions_consts.go b/api/v1beta1/conditions_consts.go index ae5d761df1..9994134d7f 100644 --- a/api/v1beta1/conditions_consts.go +++ b/api/v1beta1/conditions_consts.go @@ -118,6 +118,7 @@ const ( // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. WaitForDNSNameReason = "WaitForDNSName" // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. + // Deprecated: this condition is no longer used. WaitForDNSNameResolveReason = "WaitForDNSNameResolve" // LoadBalancerFailedReason used when an error occurs during load balancer reconciliation. LoadBalancerFailedReason = "LoadBalancerFailed" diff --git a/api/v1beta2/conditions_consts.go b/api/v1beta2/conditions_consts.go index c76dd13d5b..8c7cac9b3b 100644 --- a/api/v1beta2/conditions_consts.go +++ b/api/v1beta2/conditions_consts.go @@ -118,6 +118,7 @@ const ( // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. WaitForDNSNameReason = "WaitForDNSName" // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. + // Deprecated: This condition is no longer used. WaitForDNSNameResolveReason = "WaitForDNSNameResolve" // LoadBalancerFailedReason used when an error occurs during load balancer reconciliation. LoadBalancerFailedReason = "LoadBalancerFailed" diff --git a/controllers/awscluster_controller.go b/controllers/awscluster_controller.go index b9b669d685..6d914a8137 100644 --- a/controllers/awscluster_controller.go +++ b/controllers/awscluster_controller.go @@ -19,7 +19,6 @@ package controllers import ( "context" "fmt" - "net" "time" "github.com/google/go-cmp/cmp" @@ -313,13 +312,6 @@ func (r *AWSClusterReconciler) reconcileNormal(clusterScope *scope.ClusterScope) return reconcile.Result{RequeueAfter: 15 * time.Second}, nil } - clusterScope.Debug("looking up IP address for DNS", "dns", awsCluster.Status.Network.APIServerELB.DNSName) - if _, err := net.LookupIP(awsCluster.Status.Network.APIServerELB.DNSName); err != nil { - clusterScope.Error(err, "failed to get IP address for dns name", "dns", awsCluster.Status.Network.APIServerELB.DNSName) - conditions.MarkFalse(awsCluster, infrav1.LoadBalancerReadyCondition, infrav1.WaitForDNSNameResolveReason, clusterv1.ConditionSeverityInfo, "") - clusterScope.Info("Waiting on API server ELB DNS name to resolve") - return reconcile.Result{RequeueAfter: 15 * time.Second}, nil - } conditions.MarkTrue(awsCluster, infrav1.LoadBalancerReadyCondition) awsCluster.Spec.ControlPlaneEndpoint = clusterv1.APIEndpoint{ diff --git a/controllers/awscluster_controller_unit_test.go b/controllers/awscluster_controller_unit_test.go index e074b4b072..02b2535946 100644 --- a/controllers/awscluster_controller_unit_test.go +++ b/controllers/awscluster_controller_unit_test.go @@ -363,31 +363,6 @@ func TestAWSClusterReconcileOperations(t *testing.T) { g.Expect(err).To(BeNil()) expectAWSClusterConditions(g, cs.AWSCluster, []conditionAssertion{{infrav1.LoadBalancerReadyCondition, corev1.ConditionFalse, clusterv1.ConditionSeverityInfo, infrav1.WaitForDNSNameReason}}) }) - t.Run("Should fail AWSCluster create with LoadBalancer reconcile failure with WaitForDNSNameResolve condition as false", func(t *testing.T) { - g := NewWithT(t) - awsCluster := getAWSCluster("test", "test") - runningCluster := func() { - networkSvc.EXPECT().ReconcileNetwork().Return(nil) - sgSvc.EXPECT().ReconcileSecurityGroups().Return(nil) - ec2Svc.EXPECT().ReconcileBastion().Return(nil) - elbSvc.EXPECT().ReconcileLoadbalancers().Return(nil) - } - csClient := setup(t, &awsCluster) - defer teardown() - runningCluster() - cs, err := scope.NewClusterScope( - scope.ClusterScopeParams{ - Client: csClient, - Cluster: &clusterv1.Cluster{}, - AWSCluster: &awsCluster, - }, - ) - awsCluster.Status.Network.APIServerELB.DNSName = "test-apiserver.us-east-1.aws" - g.Expect(err).To(BeNil()) - _, err = reconciler.reconcileNormal(cs) - g.Expect(err).To(BeNil()) - expectAWSClusterConditions(g, cs.AWSCluster, []conditionAssertion{{infrav1.LoadBalancerReadyCondition, corev1.ConditionFalse, clusterv1.ConditionSeverityInfo, infrav1.WaitForDNSNameResolveReason}}) - }) }) }) t.Run("Reconcile delete AWSCluster", func(t *testing.T) {