-
Notifications
You must be signed in to change notification settings - Fork 545
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
fix(subscriptions): respect startingCSV #676
fix(subscriptions): respect startingCSV #676
Conversation
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 great! Couple of comments on the tests
@@ -239,7 +239,7 @@ func TestNamespaceSourceQuerier_FindPackage(t *testing.T) { | |||
q := &NamespaceSourceQuerier{ | |||
sources: tt.fields.sources, | |||
} | |||
got, key, err := q.FindPackage(tt.args.pkgName, tt.args.channelName, tt.args.initialSource) | |||
got, key, err := q.FindPackage(tt.args.pkgName, tt.args.channelName, "", tt.args.initialSource) | |||
require.Equal(t, tt.out.bundle, got) |
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.
Unit tests for new querier behavior?
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.
Will do.
test/e2e/subscription_e2e_test.go
Outdated
require.Equal(t, v1alpha1.InstallPlanPhaseComplete, fetchedInstallPlan.Status.Phase) | ||
|
||
// Wait for csvA to be found | ||
fetchedCSV, err := fetchCSV(t, crc, csvA.GetName(), testNamespace, buildCSVConditionChecker(v1alpha1.CSVPhaseSucceeded, v1alpha1.CSVPhaseFailed)) |
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 could be racy, right? What if by the time this happens, we’ve synced again and updated from csvA to csvB?
Maybe we do an manual approval?
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.
You're totally right - I just pushed up what I had locally. I think a manual approval might work.
54d27f2
to
adb6083
Compare
adb6083
to
4a4f1e4
Compare
/retest |
302cdec
to
f5faef4
Compare
f5faef4
to
3d4047a
Compare
/retest |
3 similar comments
/retest |
/retest |
/retest |
3d4047a
to
4967e23
Compare
/retest |
5815c6d
to
73f698c
Compare
/retest |
4660665
to
e758bb4
Compare
e758bb4
to
11c28e1
Compare
/retest |
@@ -56,21 +55,35 @@ func (q *NamespaceSourceQuerier) FindProvider(api opregistry.APIKey) (*opregistr | |||
return nil, nil, fmt.Errorf("%s not provided by a package in any CatalogSource", api) | |||
} | |||
|
|||
func (q *NamespaceSourceQuerier) FindPackage(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error) { | |||
func (q *NamespaceSourceQuerier) FindPackage(pkgName, channelName, csvName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error) { |
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.
I think this would be better as two separate functions, e.g. FindBundle
and FindLatestBundle
, etc.
11c28e1
to
32c9692
Compare
|
||
logger.Debug("checking if subscriptions need update") | ||
|
||
subs, err := o.lister.OperatorsV1alpha1().SubscriptionLister().Subscriptions(namespace).List(labels.Everything()) | ||
if err != 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.
Why is this removed?
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.
Good catch - probably happened during the rebase.
32c9692
to
621bc27
Compare
@@ -112,7 +111,6 @@ func (r *OperatorsV1alpha1Resolver) ResolveSteps(namespace string, sourceQuerier | |||
if subExists && existingSubscription.Status.CurrentCSV != op.Identifier() { | |||
existingSubscription.Status.CurrentCSV = op.Identifier() | |||
updatedSubs = append(updatedSubs, existingSubscription) | |||
continue |
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.
Why are these removed?
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.
I didn't (and doesn't) look like this continue
is skipping any logic between here and the next iteration of the loop.
/lgtm
…On Wed, Jan 30, 2019 at 7:12 PM Nick Hale ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/controller/registry/resolver/resolver.go
<#676 (comment)>
:
> @@ -112,7 +111,6 @@ func (r *OperatorsV1alpha1Resolver) ResolveSteps(namespace string, sourceQuerier
if subExists && existingSubscription.Status.CurrentCSV != op.Identifier() {
existingSubscription.Status.CurrentCSV = op.Identifier()
updatedSubs = append(updatedSubs, existingSubscription)
- continue
I didn't (and doesn't) look like this continue is skipping any logic
between here and the next iteration of the loop.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#676 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADix-OztHj2bgrc7QWcujgi31re6-o2ks5vIjTYgaJpZM4aJO5W>
.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, njhale 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 |
fix(subscriptions): respect startingCSV
Fixes
Subscription
resolution to respect theStartingCSV
field.Addresses ALM-851.