-
Notifications
You must be signed in to change notification settings - Fork 552
Removes error silencing from IsFailForwardEnabled #2957
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
Removes error silencing from IsFailForwardEnabled #2957
Conversation
Skipping CI for Draft Pull Request. |
02cff6c
to
e781c82
Compare
f7656be
to
c682d1a
Compare
@@ -335,6 +335,7 @@ func TestResolver(t *testing.T) { | |||
name: "SubscriptionOmitsChannel", | |||
clusterState: []runtime.Object{ | |||
newSub(namespace, "package", "", catalog), | |||
newOperatorGroup("foo", namespace), |
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.
Note: there is a lot of copy-pasted newOperatorGroup("foo", namespace)
lines. What is not very visible in the diff is that there are some calls for newOperatorGroup
where strategy is set to fail forward.
Previously presence of OG in cluster state was not required in this test (and in others in this PR) because was len(ogs) == 0
condition in IsFailForwardEnabled
which was returning a default value for a timeout and now we explicitly return an error in this case. So tests had to be updated.
/approve |
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 - thank you!!!!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: m1kola, perdasilva 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 |
c682d1a
to
579a0d7
Compare
Signed-off-by: Mikalai Radchuk <[email protected]>
579a0d7
to
d6158bf
Compare
/lgtm |
Description of the change:
IsFailForwardEnabled
is currently silincing errors fromList
method. This change makes it propogate errors to the caller.IsFailForwardEnabled
currently has a specifal case for situation where there are 0OperatorGroups
(len(ogs) == 0
) which no longer makes sense: oneOperatorGroups
is required. This now falls into more genericlen(ogs) != 1
condition.Main change is in
pkg/controller/registry/resolver/fail_forward.go
. Everything else is just updates required to fix tests: many of them were working without a fake operator group before.Motivation for the change:
Follow up from this conversation - #2952 (comment).
Architectural changes:
Change in how we handle zero
OperatorGroups
.Testing remarks:
Existing tests should cover the change.
Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue