Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Set ByoHost status to K8sNodeBootstrapSucceeded if /run/cluster-api/b…
Browse files Browse the repository at this point in the history
…ootstrap-success.complete exists

It helps to make clusterctl move process more simple, without a need to issue CSRs and update ~/.byoh/config by yourself
  • Loading branch information
syndicut committed Mar 20, 2024
1 parent ecc0e3d commit 459c288
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent/reconciler/host_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func (r *HostReconciler) reconcileNormal(ctx context.Context, byoHost *infrastru
return ctrl.Result{}, nil
}

if _, err := os.Stat(bootstrapSentinelFile); err == nil {
logger.Info("Found sentinel file, setting BootstrapK8sNodeSucceeded condition to true")
conditions.MarkTrue(byoHost, infrastructurev1beta1.K8sNodeBootstrapSucceeded)
}

if !conditions.IsTrue(byoHost, infrastructurev1beta1.K8sNodeBootstrapSucceeded) {
bootstrapScript, err := r.getBootstrapScript(ctx, byoHost.Spec.BootstrapSecret.Name, byoHost.Spec.BootstrapSecret.Namespace)
if err != nil {
Expand Down

0 comments on commit 459c288

Please sign in to comment.