-
Notifications
You must be signed in to change notification settings - Fork 550
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
feat(resolver): filtering deprecated bundles in resolver #1673
feat(resolver): filtering deprecated bundles in resolver #1673
Conversation
waiting on operator-framework/operator-registry#397 |
807be79
to
e74f576
Compare
64fc053
to
2467b25
Compare
33bdf15
to
6fa52e8
Compare
@@ -73,6 +73,8 @@ func (r *SatResolver) SolveOperators(namespaces []string, csvs []*v1alpha1.Clust | |||
predicates = append(predicates, WithChannel(sub.Spec.Channel)) | |||
} | |||
|
|||
predicates = append(predicates, WithoutDeprecatedProperty()) |
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.
this applies for finding updates / new installs, but we also need this predicate when searching for dependency candidates - see line 302 in getBundleInstallables
6fa52e8
to
fb80c64
Compare
/hold |
/retest |
Looking this is missing some |
This PR can be merged when it is lgtm and approve. I remove the hold. |
fb80c64
to
4988c89
Compare
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.
Have a couple of comments @gallettilance
@@ -416,6 +416,18 @@ func WithPackage(pkg string) OperatorPredicate { | |||
} | |||
} | |||
|
|||
func WithoutDeprecatedProperty() OperatorPredicate { | |||
return func(o *Operator) bool { | |||
props := o.bundle.GetProperties() |
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
: properties
, since you've already used properties
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.
there is only one deprecated property per bundle
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.
Isn't GetProperties
returning properties
(irrespective of whether those properties are deprecated or not)? And there's a for loop after this that's iterating on the properties
we're getting from GetProperties
return func(o *Operator) bool {
properties := o.bundle.GetProperties()
for _, property := range properties {
if property is deprecated {
return false
}
}
return true
}
reads much better
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.
Alternatively, you could eliminate the variable properties
completely:
for _, p := range o.bundle.GetProperties()
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.
@anik120 I thought you were talking about the function name - this makes sense to me
@@ -297,8 +297,6 @@ func NewOperatorFromBundle(bundle *api.Bundle, startingCSV string, sourceKey reg | |||
return op, 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.
Looks like this file hasn't really been changed and just has noises.
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.
different go formatting I guess
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.
Would reduce noise in this PR if this was reverted back.
/retest |
/retest |
4988c89
to
f491252
Compare
f491252
to
8cd1b77
Compare
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, gallettilance 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
/lgtm |
/retest |
1 similar comment
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
2 similar comments
/retest |
/retest |
If these are passing locally, you probably need to rebase and check this out. |
/retest |
@gallettilance: The following tests failed, say
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. |
Replaced by #1699 |
Description of the change:
Motivation for the change:
Reviewer Checklist
/docs