Skip to content
Closed
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
10 changes: 8 additions & 2 deletions internal/controller/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,22 +317,28 @@ func (r *RuleReadinessController) removeTaintBySpec(ctx context.Context, node *c
}

// Bootstrap completion tracking.
// bootstrapAnnotationKey returns the annotation key used to track bootstrap
// completion for a given rule.
func bootstrapAnnotationKey(ruleName string) string {
return fmt.Sprintf("readiness.k8s.io/bootstrap-completed-%s", ruleName)
}

func (r *RuleReadinessController) isBootstrapCompleted(ctx context.Context, nodeName, ruleName string) bool {
// Check node annotation
node := &corev1.Node{}
if err := r.Get(ctx, client.ObjectKey{Name: nodeName}, node); err != nil {
return false
}

annotationKey := fmt.Sprintf("readiness.k8s.io/bootstrap-completed-%s", ruleName)
annotationKey := bootstrapAnnotationKey(ruleName)
_, exists := node.Annotations[annotationKey]
return exists
}

func (r *RuleReadinessController) markBootstrapCompleted(ctx context.Context, nodeName, ruleName string) {
log := ctrl.LoggerFrom(ctx)

annotationKey := fmt.Sprintf("readiness.k8s.io/bootstrap-completed-%s", ruleName)
annotationKey := bootstrapAnnotationKey(ruleName)
marked := false

// retry to handle conflict with concurrent node updates
Expand Down