What happened?
During the review of PR #315, @ajaysundark identified a misconfiguration risk with anyOf rules.
When conditionPolicy is set to anyOf, the rule is satisfied as soon as any single condition matches its requiredStatus. If one of those conditions also defines a defaultStatus equal to its requiredStatus, the controller treats the condition as satisfied whenever it is absent from the Node, because the default value already matches the requirement.
This causes the anyOf evaluation to short-circuit immediately, and the taint is never applied. The misconfiguration is completely silent; nothing in the status or events indicates the rule is effectively a no-op.
Steps to Reproduce
Create a rule with conditionPolicy: anyOf that includes:
yaml
conditions:
- type: "gpu.example.com/HardwareDriverReady"
requiredStatus: "True"
defaultStatus: "True" # ← matches requiredStatus
If the Node never reports HardwareDriverReady, the controller defaults it to True, which satisfies the anyOf check. The taint is never applied, and the Node appears ready despite the driver never having initialized.
Expected Behavior
The controller should reject this misconfiguration. As discussed with @AnuragThePathak in PR #315, we should:
- Add a Go webhook validation to reject NodeReadinessRule objects where conditionPolicy is anyOf and any condition's defaultStatus equals its requiredStatus.
- Update the documentation to explicitly describe this restriction.
Controller Version / Image Tag
main branch / PR #315
Kubernetes Version
N/A
Controller Logs
N/A
Additional Environment Details
This follow-up issue was created based on the post-review discussion in PR #315.
What happened?
During the review of PR #315, @ajaysundark identified a misconfiguration risk with
anyOfrules.When
conditionPolicyis set toanyOf, the rule is satisfied as soon as any single condition matches itsrequiredStatus. If one of those conditions also defines adefaultStatusequal to itsrequiredStatus, the controller treats the condition as satisfied whenever it is absent from the Node, because the default value already matches the requirement.This causes the
anyOfevaluation to short-circuit immediately, and the taint is never applied. The misconfiguration is completely silent; nothing in the status or events indicates the rule is effectively a no-op.Steps to Reproduce
Create a rule with
conditionPolicy: anyOfthat includes:yaml
If the Node never reports
HardwareDriverReady, the controller defaults it to True, which satisfies theanyOfcheck. The taint is never applied, and the Node appears ready despite the driver never having initialized.Expected Behavior
The controller should reject this misconfiguration. As discussed with @AnuragThePathak in PR #315, we should:
Controller Version / Image Tag
main branch / PR #315
Kubernetes Version
N/A
Controller Logs
N/A
Additional Environment Details
This follow-up issue was created based on the post-review discussion in PR #315.