Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove wait for DNS records to resolve #4561

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/v1beta1/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions api/v1beta2/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions controllers/awscluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package controllers
import (
"context"
"fmt"
"net"
"time"

"github.com/google/go-cmp/cmp"
Expand Down Expand Up @@ -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{
Expand Down
25 changes: 0 additions & 25 deletions controllers/awscluster_controller_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down