Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 5a9a13b

Browse files
committed
Cause reconcile to cluster to try again if control plane is not ready
1 parent 81ad087 commit 5a9a13b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Gopkg.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cloud/packet/actuators/cluster/actuator.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ import (
2020
"fmt"
2121
"log"
2222
"reflect"
23+
"time"
2324

2425
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/ca"
2526
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/deployer"
2627
clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1"
2728
client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1"
29+
controllerError "sigs.k8s.io/cluster-api/pkg/controller/error"
2830
)
2931

32+
// if the control plane is not ready, wait 15 seconds and try again
33+
const waitForControlPlaneMachineDuration = 15 * time.Second
34+
3035
// Add RBAC rules to access cluster-api resources
3136
//+kubebuilder:rbac:groups=cluster.k8s.io,resources=clusters;clusters/status,verbs=get;list;watch;update
3237

@@ -72,9 +77,9 @@ func (a *Actuator) Reconcile(cluster *clusterv1.Cluster) error {
7277
_, isNoIP := err.(*deployer.MachineNoIP)
7378
switch {
7479
case err != nil && isNoMachine:
75-
return nil
80+
return &controllerError.RequeueAfterError{RequeueAfter: waitForControlPlaneMachineDuration}
7681
case err != nil && isNoIP:
77-
return nil
82+
return &controllerError.RequeueAfterError{RequeueAfter: waitForControlPlaneMachineDuration}
7883
case err != nil:
7984
return err
8085
case err == nil:

0 commit comments

Comments
 (0)