Skip to content
Open
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
9 changes: 6 additions & 3 deletions internal/webhook/nodereadinessgaterule_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ func (w *NodeReadinessRuleWebhook) validateTaintConflicts(ctx context.Context, r
// List all existing rules
ruleList := &readinessv1alpha1.NodeReadinessRuleList{}
if err := w.List(ctx, ruleList); err != nil {
// If we can't list rules, allow the operation but log the issue
ctrl.Log.Error(err, "Failed to list rules for conflict validation")
return allErrs
// Fail closed: if we can't list rules, we cannot safely validate
// for conflicts. Reject the request so the client can retry.
return append(allErrs, field.InternalError(
field.NewPath("spec", "taint", "key"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about using field.NewPath("spec", "taint", "key") here. A List failure is a systemic/infrastructure issue, not an error with the user's input in that specific field. Attributing it to the taint key could be misleading for users debugging their YAML.

fmt.Errorf("unable to validate taint conflicts, please retry: %w", err),
))
}

taintField := field.NewPath("spec", "taint", "key")
Expand Down
Loading