openshift / cluster-node-tuning-operator

Manage node-level tuning by orchestrating the tuned daemon.
Apache License 2.0
102 stars 105 forks source link

OCPBUGS-29594: e2e: fix comparing incompatible types #957

Closed mrniranjan closed 9 months ago

mrniranjan commented 9 months ago

This patch fixes comparing incompatible types, profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)

Instead of using pointer.Bool, directly compare the boolean value.

openshift-ci[bot] commented 9 months ago

[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: - ~~[OWNERS](https://github.com/openshift/cluster-node-tuning-operator/blob/master/OWNERS)~~ [jmencak] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jmencak commented 9 months ago

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: /lgtm

mrniranjan commented 9 months ago

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: /lgtm

@jmencak If for some reason profile is nil, it will fail very early in the test.

jmencak commented 9 months ago

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: /lgtm

@jmencak If for some reason profile is nil, it will fail very early in the test.

I'm not worried about profile == nil. Can profile.Spec.RealTimeKernel be nil though?

func main() {
        var profile PerformanceProfile

        fmt.Printf("PoC=%v\n", profile.Spec.RealTimeKernel.Enabled)
}

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x47c75e]

goroutine 1 [running]:
main.main()
        /home/mencak/work/programs/golang/mine/index/index.go:229 +0x3e
jmencak commented 9 months ago

/hold please unhold when we're sure this cannot happen ^

mrniranjan commented 9 months ago

@jmencak

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

openshift-ci-robot commented 9 months ago

@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to [this](https://github.com/openshift/cluster-node-tuning-operator/pull/957): >This patch fixes comparing incompatible types, >profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false) > >Instead of using pointer.Bool, directly compare the boolean value. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fcluster-node-tuning-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
mrniranjan commented 9 months ago

/jira refresh

openshift-ci-robot commented 9 months ago

@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to [this](https://github.com/openshift/cluster-node-tuning-operator/pull/957#issuecomment-1947879333): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fcluster-node-tuning-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
mrniranjan commented 9 months ago

/jira refresh

openshift-ci-robot commented 9 months ago

@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 * bug is open, matching expected state (open) * bug target version (4.16.0) matches configured target version for branch (4.16.0) * bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact: /cc @gsr-shanks

In response to [this](https://github.com/openshift/cluster-node-tuning-operator/pull/957#issuecomment-1947880266): > >/jira refresh > > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fcluster-node-tuning-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
jmencak commented 9 months ago

/unhold

openshift-ci-robot commented 9 months ago

/retest-required

Remaining retests: 0 against base HEAD d7c3111b261fb58963a1bf184ca1c014a1f4fcd6 and 2 for PR HEAD 1ae4a1426ea97a57f5f5a09aa103b1ae7bf77de4 in total

openshift-ci[bot] commented 9 months ago

@mrniranjan: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci-robot commented 9 months ago

@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 refresh.

Jira Issue OCPBUGS-29594 has not been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/cluster-node-tuning-operator/pull/957): >This patch fixes comparing incompatible types, >profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false) > >Instead of using pointer.Bool, directly compare the boolean value. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fcluster-node-tuning-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-bot commented 9 months ago

[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. All builds following this will include this PR.

mrniranjan commented 9 months ago

/cherry-pick release-4.15

openshift-cherrypick-robot commented 9 months ago

@mrniranjan: #957 failed to apply on top of branch "release-4.15":

Applying: e2e: fix comparing incompatible types
Using index info to reconstruct a base tree...
M   test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
CONFLICT (content): Merge conflict in test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 e2e: fix comparing incompatible types
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to [this](https://github.com/openshift/cluster-node-tuning-operator/pull/957#issuecomment-1949614777): >/cherry-pick release-4.15 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-merge-robot commented 8 months ago

Fix included in accepted release 4.16.0-0.nightly-2024-03-23-173230