-
Notifications
You must be signed in to change notification settings - Fork 118
OCPBUGS-59354: E2E add test to verify guaranteed pod is running after kubelet restart #1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCPBUGS-59354: E2E add test to verify guaranteed pod is running after kubelet restart #1361
Conversation
This PR addresses issue where we are verifying if the cpu manager state file is same after kubelet restart while we are verifying the above, we are not checking if Guranteed pod started before kubelet restart is also still running. Refer: https://issues.redhat.com/browse/OCPBUGS-43280 Signed-off-by: Niranjan M.R <[email protected]>
|
|
||
| By("verify test pod comes back after kubelet restart") | ||
| Eventually(func() error { | ||
| updatedPod := &corev1.Pod{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can reduce code complexity and avoid using references, instead you can use like this:
var updatedPod corev1.Pod
Eventually(func() error{
err := testclient.DataPlaneClient.Get(ctx, client.ObjectKeyFromObject(testpod), &updatedPod)
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in latest commit
| for _, condition := range updatedPod.Status.Conditions { | ||
| if condition.Type == corev1.PodReady && condition.Status == corev1.ConditionTrue { | ||
| testlog.Infof("post kubelet restart pod is ready with UID: %v", updatedPod.UID) | ||
| return nil | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make the function here more consistent with the flow, as in apply negative conditions if none is met then return nil (i.e succeeds); this can be done like this:
for _, condition := range updatedPod.Status.Conditions {
if condition.Type == corev1.PodReady && condition.Status != corev1.ConditionTrue {
return fmt.Errorf("pod condition is not ready after restart: conditions=%v", updatedPod.Status.Conditions)
}
}
return nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in latest commit.
Signed-off-by: Niranjan M.R <[email protected]>
swatisehgal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Mostly looks good, some minor comments.
| // Check pod ready condition | ||
| for _, condition := range updatedPod.Status.Conditions { | ||
| if condition.Type == corev1.PodReady && condition.Status != corev1.ConditionTrue { | ||
| return fmt.Errorf("Pod ondition is not in Ready state after kubelet restart: condition: %v", updatedPod.Status.Conditions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT:
| return fmt.Errorf("Pod ondition is not in Ready state after kubelet restart: condition: %v", updatedPod.Status.Conditions) | |
| return fmt.Errorf("Pod condition is not in Ready state after kubelet restart: condition: %v", updatedPod.Status.Conditions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in latest commit
| } | ||
| // Check pod ready condition | ||
| for _, condition := range updatedPod.Status.Conditions { | ||
| if condition.Type == corev1.PodReady && condition.Status != corev1.ConditionTrue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case pod condition is ready but fails the condition status check would be nice to point out condition Reason and condition Message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in latest commit
Signed-off-by: Niranjan M.R <[email protected]>
swatisehgal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
/test okd-scos-e2e-aws-ovn |
|
/test e2e-aws-ovn-techpreview |
|
/test e2e-aws-ovn |
|
@mrniranjan: This pull request references Jira Issue OCPBUGS-59354, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: mrniranjan. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions 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. |
|
/test e2e-aws-ovn |
|
@yanirq can you approve this PR |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MarSik, mrniranjan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
|
@mrniranjan: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
@mrniranjan: Jira Issue OCPBUGS-59354: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-59354 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/cherry-pick release-4.19 |
|
@mrniranjan: new pull request created: #1365 DetailsIn response to this:
Instructions 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. |
|
[ART PR BUILD NOTIFIER] Distgit: cluster-node-tuning-operator |
This PR addresses issue where we are verifying
if the cpu manager state file is same after kubelet restart while we are verifying the above, we are not checking if Guranteed pod started before kubelet restart is also still running.
Refer: https://issues.redhat.com/browse/OCPBUGS-43280