Remove duplicate bootstrap duration observation in taint removal path#285
Remove duplicate bootstrap duration observation in taint removal path#285rawadhossain wants to merge 2 commits into
Conversation
Signed-off-by: Rawad Hossain <rawad.hossain00@gmail.com>
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rawadhossain 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 |
|
Hi @rawadhossain. 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. |
|
/ok-to-test /cc @Karthik-K-N |
Karthik-K-N
left a comment
There was a problem hiding this comment.
Thank you for catching this. If possible we can do small improvement in test from the readability and stability aspect apart from that LGTM. Thank you.
| Status: corev1.NodeStatus{ | ||
| Conditions: []corev1.NodeCondition{ | ||
| { | ||
| Type: "Ready", | ||
| Status: corev1.ConditionTrue, | ||
| LastTransitionTime: transitionTime, | ||
| }, | ||
| }, | ||
| }, | ||
| } |
There was a problem hiding this comment.
I think it does not matter, wont the create ignore status?
Usually we create only with spec
There was a problem hiding this comment.
you're right. Removed the Status block, now node is created with spec only
| Expect(k8sClient.Get(ctx, types.NamespacedName{Name: nodeName}, node)).To(Succeed()) | ||
| node.Status.Conditions[0].LastTransitionTime = transitionTime | ||
| node.Status.Conditions[0].Status = corev1.ConditionTrue | ||
| Expect(k8sClient.Status().Update(ctx, node)).To(Succeed()) |
There was a problem hiding this comment.
Usually Update() call should go inside a Eventually block to have some retry, How about something like this
Eventually(func() error {
if err := k8sClient.Get(ctx, types.NamespacedName{Name: nodeName}, node); err != nil {
return err
}
node.Status.Conditions = []corev1.NodeCondition{
{
Type: "Ready",
Status: corev1.ConditionTrue,
LastTransitionTime: transitionTime,
},
}
return k8sClient.Status().Update(ctx, node)
}, "5s", "100ms").Should(Succeed())
There was a problem hiding this comment.
Thanks for pointing this out. Commiting the changes now.
Description
cleanup: duplicate observation of node_readiness_bootstrap_duration_seconds in the bootstrap-only taint removal path.
Two consecutive observation blocks recording the same bootstrap completion event.
This is important because upcoming metrics, dashboards, and SLOs rely on this histogram for accurate calculations. Duplicate samples would skew those results.
Files changed
internal/controller/nodereadinessrule_controller.gointernal/controller/nodereadinessrule_controller_test.gohistogramSampleCounthelperType of Change
/kind bug
Testing
Added test to verify the histogram sample count increases by exactly one for a bootstrap completion event
make testmake lintChecklist
make testpassesmake lintpasses