Skip to content

OCPVE-717: fix: add if check for no resource match error#801

Merged
openshift-ci[bot] merged 1 commit intoopenshift:masterfrom
eggfoobar:fix-optional-olm-install
Oct 4, 2023
Merged

OCPVE-717: fix: add if check for no resource match error#801
openshift-ci[bot] merged 1 commit intoopenshift:masterfrom
eggfoobar:fix-optional-olm-install

Conversation

@eggfoobar
Copy link
Copy Markdown
Contributor

OLM will be made optional in 4.15, when OLM resources are removed, the error check fails to be caught with IsNotFound resulting in a false positive error. Updating to also check for NoResourceMatchError

Copy link
Copy Markdown
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but how can we test this change?

@eggfoobar
Copy link
Copy Markdown
Contributor Author

/hold

Had an error pop up in validation, I had validated this working with a small app with a release that had no OLM, however rebuilding the build with this fix seems to not resolve the error, not sure if cluster bot picked up the right SHA. Will validate tomorrow morning.

@ffromani Unfortunately, There is no great way to run a pipeline of this working since we're in the early development of removing OLM and It requires changes in a few operators for the feature to work properly. I will run another cluster with this change in tomorrow and make sure it works as intended.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2023
@ffromani
Copy link
Copy Markdown
Contributor

@ffromani Unfortunately, There is no great way to run a pipeline of this working since we're in the early development of removing OLM and It requires changes in a few operators for the feature to work properly. I will run another cluster with this change in tomorrow and make sure it works as intended.

verification is surely welcome, but in general this flow is relatively complex and fragile (because it runs rarely and only in special cases). It would be great to have better test coverage to increase the confidence.

@eggfoobar eggfoobar force-pushed the fix-optional-olm-install branch from 7b590aa to 63f73d7 Compare September 20, 2023 05:17
@eggfoobar
Copy link
Copy Markdown
Contributor Author

eggfoobar commented Sep 20, 2023

More tests are always better, I'm not entirely sure of the best way to test this part, but since I'm already poking around there I can try and take a stab at an e2e test if that's possible for an upgrade cycle. Unit test might be best here, what do you think?

Side note, the extra if checks won't change the behavior of that method so we're good there, this just adds an extra check for when the OLM goes optional.

@eggfoobar eggfoobar force-pushed the fix-optional-olm-install branch from 63f73d7 to 8cad7fa Compare September 22, 2023 20:24
@eggfoobar eggfoobar changed the title fix: add if check for no resource match error OCPVE-717: fix: add if check for no resource match error Sep 27, 2023
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Sep 27, 2023

@eggfoobar: This pull request references OCPVE-717 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

Details

In response to this:

OLM will be made optional in 4.15, when OLM resources are removed, the error check fails to be caught with IsNotFound resulting in a false positive error. Updating to also check for NoResourceMatchError

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 27, 2023
@eggfoobar eggfoobar force-pushed the fix-optional-olm-install branch from 8cad7fa to 764786b Compare September 28, 2023 14:35
@eggfoobar
Copy link
Copy Markdown
Contributor Author

/unhold

After some research, the issue in validation was around the error being wrapped and discovery helper func not being able to handle that scenario. I added a util helper to check. @ffromani Seems the unit test might be the best approach here, what do you think?

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 28, 2023
@eggfoobar
Copy link
Copy Markdown
Contributor Author

/retest-required

2 similar comments
@eggfoobar
Copy link
Copy Markdown
Contributor Author

/retest-required

@eggfoobar
Copy link
Copy Markdown
Contributor Author

/retest-required

Comment thread cmd/cluster-node-tuning-operator/main.go Outdated
upkeep, removed redundant if nill check

Signed-off-by: ehila <ehila@redhat.com>

fix: added util to help parse error from discovery and meta error

Signed-off-by: ehila <ehila@redhat.com>

fix: added unit tests for error check

Signed-off-by: ehila <ehila@redhat.com>
@eggfoobar eggfoobar force-pushed the fix-optional-olm-install branch from 764786b to 7408f0b Compare October 3, 2023 12:43
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Oct 3, 2023

@eggfoobar: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@eggfoobar
Copy link
Copy Markdown
Contributor Author

@ffromani When you get a chance, this should be good now for a final review.

@yanirq
Copy link
Copy Markdown
Contributor

yanirq commented Oct 4, 2023

/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Oct 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar, yanirq

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2023
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Oct 4, 2023

@eggfoobar: This pull request references OCPVE-717 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

Details

In response to this:

OLM will be made optional in 4.15, when OLM resources are removed, the error check fails to be caught with IsNotFound resulting in a false positive error. Updating to also check for NoResourceMatchError

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.

Copy link
Copy Markdown
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2023
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Oct 4, 2023

@eggfoobar: This pull request references OCPVE-717 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

Details

In response to this:

OLM will be made optional in 4.15, when OLM resources are removed, the error check fails to be caught with IsNotFound resulting in a false positive error. Updating to also check for NoResourceMatchError

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.

@openshift-ci openshift-ci Bot merged commit bcdb1c5 into openshift:master Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants