diff --git a/cloud/scope/common.go b/cloud/scope/common.go index d5ac9554b..3e912f23e 100644 --- a/cloud/scope/common.go +++ b/cloud/scope/common.go @@ -28,9 +28,6 @@ func CreateLinodeClient(apiKey string) (*linodego.Client, error) { } linodeClient := linodego.NewClient(oauth2Client) - // Disable client retries to rely on controller requeues and unblock the loop. - linodeClient.SetRetryCount(0) - linodeClient.SetUserAgent(fmt.Sprintf("CAPL/%s", version.GetVersion())) return &linodeClient, nil diff --git a/cloud/services/loadbalancers_test.go b/cloud/services/loadbalancers_test.go index 990af5381..0359201cb 100644 --- a/cloud/services/loadbalancers_test.go +++ b/cloud/services/loadbalancers_test.go @@ -458,7 +458,25 @@ func TestAddNodeToNBFullWorkflow(t *testing.T) { expects func(*mock.MockLinodeMachineClient) }{ { - name: "Success - Add the node to the NodeBalancer", + name: "If the machine is not a control plane node, do nothing", + machineScope: &scope.MachineScope{ + Machine: &clusterv1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-machine", + UID: "test-uid", + }, + }, + Cluster: &clusterv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-cluster", + UID: "test-uid", + }, + }, + }, + expects: func(*mock.MockLinodeMachineClient) {}, + }, + { + name: "Success - If the machine is a control plane node, add the node to the NodeBalancer", machineScope: &scope.MachineScope{ Machine: &clusterv1.Machine{ ObjectMeta: metav1.ObjectMeta{ diff --git a/util/reconciler/defaults.go b/util/reconciler/defaults.go index 929441404..d7aa23ca5 100644 --- a/util/reconciler/defaults.go +++ b/util/reconciler/defaults.go @@ -28,8 +28,6 @@ const ( // DefaultMachineControllerWaitForBootstrapDelay is the default requeue delay if bootstrap data is not ready. DefaultMachineControllerWaitForBootstrapDelay = 5 * time.Second - // DefaultMachineControllerWaitForInstanceInitDelay is the default requeue delay during instance pre-boot initialization. - DefaultMachineControllerWaitForInstanceInitDelay = 10 * time.Second // DefaultMachineControllerLinodeImage default image. DefaultMachineControllerLinodeImage = "linode/ubuntu22.04" // DefaultMachineControllerWaitForRunningDelay is the default requeue delay if instance is not running.