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

add requeue timeouts for when machine cannot start because cluster or… #35

Merged
merged 1 commit into from
May 8, 2020
Merged
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
6 changes: 3 additions & 3 deletions controllers/packetcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ func (r *PacketClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, re
_, isNoIP := err.(*MachineNoIP)
switch {
case err != nil && isNoMachine:
logger.Info("Control plan device not found. Requeueing...")
logger.Info("Control plane device not found. Requeueing...")
return ctrl.Result{Requeue: true, RequeueAfter: 30 * time.Second}, nil
case err != nil && isNoIP:
logger.Info("Control plan device not found. Requeueing...")
logger.Info("Control plane device not found. Requeueing...")
return ctrl.Result{Requeue: true, RequeueAfter: 30 * time.Second}, nil
case err != nil:
logger.Error(err, "error getting a control plan ip")
logger.Error(err, "error getting a control plane ip")
return ctrl.Result{}, err
case err == nil:
clusterScope.PacketCluster.Status.APIEndpoints = []infrastructurev1alpha3.APIEndpoint{
Expand Down
4 changes: 2 additions & 2 deletions controllers/packetmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s

if !machineScope.Cluster.Status.InfrastructureReady {
machineScope.Info("Cluster infrastructure is not ready yet")
return ctrl.Result{}, nil
return ctrl.Result{Requeue: true, RequeueAfter: 30 * time.Second}, nil
}

// Make sure bootstrap data secret is available and populated.
if machineScope.Machine.Spec.Bootstrap.DataSecretName == nil {
machineScope.Info("Bootstrap data secret is not yet available")
return ctrl.Result{}, nil
return ctrl.Result{Requeue: true, RequeueAfter: 30 * time.Second}, nil
}

providerID := machineScope.GetInstanceID()
Expand Down