Skip to content

Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI #1521

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

Conversation

dinhxuanvu
Copy link
Member

@dinhxuanvu dinhxuanvu commented May 14, 2020

When resolver looks for an operator that provides requiredAPIs, it
doesn't exclude operators from the same package that the original
operator that requires those APIs. As a result, if there is an
existing version of that operator now provides those requiredAPIs
(due to API ownership transfer), resolver will select an older or
newer version of the same operator to fulfill that requiredAPIs
which leads to API ownership conflicts on providedAPIs.

The resolver will look up all latest channel entries that provides
the necessary requiredAPIs and filter out those from the same package
before go on with the operator selection.

Signed-off-by: Vu Dinh [email protected]

Description of the change:

Motivation for the change:
Note to reviewer:
This PR is designed to be backport-friendly as it is planned to be backported all the way down to 4.2. As a result, there are significant amount of code which is here solely for backport reason. After the backport is done, there will be follow-up PR(s) to update OLM and registry and clean up the codebase in the master.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@dinhxuanvu dinhxuanvu requested a review from ecordell May 14, 2020 06:45
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2020
@dinhxuanvu dinhxuanvu removed the request for review from benluddy May 14, 2020 06:45
@dinhxuanvu dinhxuanvu changed the title [WIP] fix(resolver): don't pick operator from same package when resolve requiredAPI [WIP] Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI May 14, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels May 14, 2020
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references Bugzilla bug 1834936, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

[WIP] Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI

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.

@dinhxuanvu dinhxuanvu force-pushed the required-api-package branch 5 times, most recently from b5df440 to d5fe81d Compare May 19, 2020 08:39
@dinhxuanvu dinhxuanvu changed the title [WIP] Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI May 19, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 19, 2020
@dinhxuanvu
Copy link
Member Author

/retest

Copy link
Contributor

@harishsurf harishsurf left a comment

Choose a reason for hiding this comment

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

Nice work Vu! I had some review comments for the e2e test. With the plan that we would have all our e2e tests in ginkgo, I have provided some pointers for the same. It could go in as part of a separate PR if this is a priority bug fix. I want everyone in the team to be familiar with the new way of writing tests. Feel free to reach out if you have any questions. I am happy to pair program if it helps :)

@dinhxuanvu
Copy link
Member Author

/retest

@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references Bugzilla bug 1834936, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI

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.

@dinhxuanvu dinhxuanvu force-pushed the required-api-package branch 5 times, most recently from bf8a7f8 to 0b033dc Compare May 20, 2020 06:25
…uiredAPI

When resolver looks for an operator that provides requiredAPIs, it
doesn't exclude operators from the same package that the original
operator that requires those APIs. As a result, if there is an
existing version of that operator now provides those requiredAPIs
(due to API ownership transfer), resolver will select an older or
newer version of the same operator to fulfill that requiredAPIs
which leads to API ownership conflicts on providedAPIs.

The resolver will look up all latest channel entries that provides
the necessary requiredAPIs and filter out those from the same package
before go on with the operator selection.

Signed-off-by: Vu Dinh <[email protected]>
1. Rename fake_registry_client to fake_registry_interface for registry
client interface.
2. Generate fake_registry_client for the actual reigstry client only.

Signed-off-by: Vu Dinh <[email protected]>
@dinhxuanvu dinhxuanvu force-pushed the required-api-package branch from 0b033dc to 9258f5f Compare May 20, 2020 13:42
Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

Looking good so far. Added some comments.

It may help to take a look at the embedding section of effective go to help guide these changes.

@dinhxuanvu
Copy link
Member Author

/retest

1 similar comment
@dinhxuanvu
Copy link
Member Author

/retest

Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 26, 2020
@dinhxuanvu dinhxuanvu force-pushed the required-api-package branch from 928b12f to 0b02331 Compare May 26, 2020 18:30
@dinhxuanvu dinhxuanvu force-pushed the required-api-package branch from 0b02331 to 57b5881 Compare May 26, 2020 18:39
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, ecordell

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@benluddy
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 26, 2020
@dinhxuanvu
Copy link
Member Author

/test e2e-gcp

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@dinhxuanvu
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@dinhxuanvu
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 8ad4341 into operator-framework:master May 27, 2020
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: All pull requests linked via external trackers have merged: operator-framework/operator-lifecycle-manager#1521. Bugzilla bug 1834936 has been moved to the MODIFIED state.

In response to this:

Bug 1834936: fix(resolver): don't pick operator from same package when resolve requiredAPI

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.

@dinhxuanvu
Copy link
Member Author

/cherry-pick release-4.4

@openshift-cherrypick-robot

@dinhxuanvu: #1521 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/controller/registry/grpc/source.go
M	pkg/controller/registry/resolver/querier.go
M	pkg/controller/registry/resolver/querier_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/registry/resolver/querier_test.go
CONFLICT (content): Merge conflict in pkg/controller/registry/resolver/querier_test.go
Auto-merging pkg/controller/registry/resolver/querier.go
Auto-merging pkg/controller/registry/grpc/source.go
CONFLICT (content): Merge conflict in pkg/controller/registry/grpc/source.go
Patch failed at 0001 fix(resolver): don't pick operator from same package when resolve requiredAPI

In response to this:

/cherry-pick release-4.4

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.

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. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants