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-29594: e2e: fix comparing incompatible types #957
OCPBUGS-29594: e2e: fix comparing incompatible types #957
Conversation
This patch fixes comparing incompatible types, profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false) Instead of using pointer.Bool, directly compare the boolean value. Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
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.
/approve
@@ -84,7 +84,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific | |||
By("Modifying profile") | |||
profile.Spec.WorkloadHints = nil | |||
|
|||
if profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false) { | |||
if *profile.Spec.RealTimeKernel.Enabled != true { |
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.
So I'm assuming we want to skip the test when
*profile.Spec.RealTimeKernel.Enabled == false
right? Would it be a bit more readable? Similarly below. Also, do we need any checks for nil pointer dereference here?
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.
Right == false would have made more readable. updating the patch
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jmencak, mrniranjan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: |
@jmencak If for some reason profile is nil, it will fail very early in the test. |
I'm not worried about profile == nil. Can
|
/hold |
Profile.Spec.RealTimeKernel cannot be nil because , realTimeKernel attribute of Performance Profile is a mandatory field to be given, It take 2 values true or false. without which Profile cannot be applied |
@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In 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. |
/jira refresh |
@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:
Comment In 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. |
/jira refresh |
@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, 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: In 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. |
/unhold |
@mrniranjan: all tests passed! Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
@mrniranjan: Jira Issue OCPBUGS-29594: Some pull requests linked via external trackers have merged: The following pull requests linked via external trackers have not merged: These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with Jira Issue OCPBUGS-29594 has not been moved to the MODIFIED state. In 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. |
[ART PR BUILD NOTIFIER] This PR has been included in build cluster-node-tuning-operator-container-v4.16.0-202402161440.p0.gabfe492.assembly.stream.el9 for distgit cluster-node-tuning-operator. |
/cherry-pick release-4.15 |
@mrniranjan: #957 failed to apply on top of branch "release-4.15":
In 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/test-infra repository. |
Fix included in accepted release 4.16.0-0.nightly-2024-03-23-173230 |
This patch fixes comparing incompatible types,
profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)
Instead of using pointer.Bool, directly compare the boolean value.