feat: add optional DefaultStatus field to ConditionRequirement for missing node conditions#283
Conversation
✅ Deploy Preview for node-readiness-controller ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AnuragThePathak The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @AnuragThePathak! |
|
Hi @AnuragThePathak. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…ssing node conditions
f351da7 to
bbabff1
Compare
Removes forbidden kubebuilder:default markers to pass the project's forbiddenmarkers CI lint check. Implements a receiver method on ConditionRequirement to handle fallback logic safely at runtime. Signed-off-by: Anurag Pathak <contact@anuragthepathak.com>
586c7dc to
0baafad
Compare
|
@AnuragThePathak Thanks for the PR. Is this ready for review? |
…atus and add defaultStatus field in CRD status Signed-off-by: Anurag Pathak <contact@anuragthepathak.com>
|
Yes @ajaysundark you can review the code changes. There are no expected changes unless suggested during review. In the meantime, I'll keep working on updating the tests which should affect the implementation review. |
|
The direction of the PR looks good to me, publish the PR so the CI kicks in. We should also document the implications of this feature. For example, defaultStatus doesnt fit for bootstrap-only enforcement mode, where 'unknown' status fit as a better default. |
9f1518e to
d44e694
Compare
|
@ajaysundark It is good from my side now. By the way you may benefit reviewing by commit, I have created different commit for separate concerns/categories. |
|
/ok-to-test |
|
/kind feature |
Description
Issue #282 already describes why need the DefaultStatus field to act as a problem-gate during node bootstrap. This PR makes the following changes to implement that -
DefaultStatusfield inConditionRequirement. TypeCorev1.ConditionStatus.GetDefaultStatus()accessor for safe access of that field. A kubebuilder schema default is not used due to project policy, so defaulting toUnknownhappens at read-time via this method.defaultStatuswhen matching a condition's effective status againstrequiredStatusfor absent conditions.Unknown) inConditionEvaluationResult.currentStatusrather than the effective (default-applied) value, preserving the "observed" semantic of the field.ConditionEvaluationResult.defaultStatusto reflect what default was configured in the spec, giving full visibility into evaluation decisions.DryRunResults.riskyOperationslogic to strictly count physically missing conditions (adhering to the API schema definition), rather than conflating them with explicitly reported Unknown statuses.make manifeststo include the newdefaultStatusproperty.Related Issue
Fixes #282
Type of Change
/kind feature
/kind api-change
Testing
Unit/Integration Tests:
getConditionStatusresolves to the configured default status when a condition is missing from a node.defaultStatusmatchesrequiredStatus(problem-gate scenario).riskyOperationsincrement, even if the condition is satisfied viadefaultStatus, and correctly flagstaintsToRemovewhile keepingtaintsToAddat0.Validation:
make testandmake lint.make test-e2e) locally; all 14 tests passed successfully, ensuring no regressions.Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?
Documentation
The following documentation files were updated:
docs/book/src/introduction.md: AddeddefaultStatusas a Key Feature.docs/book/src/user-guide/getting-started.md: AddeddefaultStatusas a third field under "Define Readiness Conditions" with a link to Concepts for implications.docs/book/src/user-guide/concepts.md: Added a new### Default Condition Status (defaultStatus)subsection covering:[!WARNING]block explicitly documenting that a satisfyingdefaultStatusmust not be used withbootstrap-onlyrules, as it permanently bypasses the gatedocs/book/src/reference/api-spec.md: AddeddefaultStatusrows to both theConditionRequirementandConditionEvaluationResulttables, with theDefault: Unknowncolumn populated forConditionRequirement(spec field), and left blank forConditionEvaluationResult(status field).