Skip to content

Bug 1827821: Generation bug 4.4 Backport #1484

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

awgreene
Copy link
Member

This PR fixes two issues with OLM's "Generation Calculator":

Problem:
If an operator is being upgraded that provides a required API whose GVK
has not changed since the previous version of the operator and
uses a skipRange instead of the Spec.Replaces field, OLM will:

  • Add the new operator to the generation, and marking the APIs it
    provides as "present".
  • Remove the old operator from the generation, marking the APIs it
    provides as "absent", despite being provided by the new version of the
    operator.
  • Attempt to resolve the "missing" APIs, overwriting the new version
    of the operator with a copy that does not have its Spec.Replaces field
    set.

This causes OLM to fail the upgrade, where the old operator's CSV will
not be replaced and the new operators CSV will run into an intercepting
API Provider issue.

Solution:
Update OLM to remove the old operator from the current generation before
adding the new operator to the generation.

Problem:
In an upgrade where v1 of Operator A provides an API and v1 of Operator
B depends on the API, where the ownership of the API is transferred from
Operator A to Operator B during the upgrade, OLM may run into a
situation where Operator B is updated first. This causes OLM to fail to
calculate the generation because multiple operator provide the same
API.

Solution:
Add and remove updates as a set to prevent the situation described
above.

@openshift-ci-robot
Copy link
Collaborator

@awgreene: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

Bugzilla 1827821: Generation bug 4.4 Backport

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.

@awgreene awgreene changed the title Bugzilla 1827821: Generation bug 4.4 Backport Bug 1827821: Generation bug 4.4 Backport Apr 25, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Apr 25, 2020
@openshift-ci-robot
Copy link
Collaborator

@awgreene: This pull request references Bugzilla bug 1827821, which is invalid:

  • expected the bug to target the "4.4.0" release, but it targets "4.4.z" instead
  • expected Bugzilla bug 1827821 to depend on a bug targeting a release in 4.5.0, 4.5.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1827821: Generation bug 4.4 Backport

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.

@awgreene
Copy link
Member Author

/test unit

@awgreene
Copy link
Member Author

/retest

awgreene and others added 2 commits April 25, 2020 15:05
Problem:
If an operator is being upgraded that provides a required API whose GVK
has not changed since the previous version of the operator and
uses a skipRange instead of the Spec.Replaces field, OLM will:
* Add the new operator to the generation, and marking the APIs it
    provides as "present".
* Remove the old operator from the generation, marking the APIs it
    provides as "absent", despite being provided by the new version of the
    operator.
* Attempt to resolve the "missing" APIs, overwriting the new version
    of the operator with a copy that  does not have its Spec.Replaces field
    set.

This causes OLM to fail the upgrade, where the old operator's CSV will
not be replaced and the new operators CSV will run into an intercepting
API Provider issue.

Solution:
Update OLM to remove the old operator from the current generation before
adding the new operator to the generation.
Problem:
In an upgrade where v1 of Operator A provides an API and v1 of Operator
B depends on the API, where the ownership of the API is transferred from
Operator A to Operator B during the upgrade, OLM may run into a
situation where Operator B is updated first. This causes OLM to fail to
calculate the generation because multiple operator provide the same
API.

Solution:
Add and remove updates as a set to prevent the situation described
above.
@awgreene awgreene force-pushed the generation-bug-4.4 branch from 4af58b4 to e11d566 Compare April 25, 2020 19:05
@awgreene
Copy link
Member Author

/cherry-pick release-4.3

@openshift-cherrypick-robot

@awgreene: once the present PR merges, I will cherry-pick it on top of release-4.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.3

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.

@awgreene
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Collaborator

@awgreene: This pull request references Bugzilla bug 1827821, which is invalid:

  • expected the bug to target the "4.4.0" release, but it targets "4.4.z" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@awgreene
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels Apr 30, 2020
@openshift-ci-robot
Copy link
Collaborator

@awgreene: This pull request references Bugzilla bug 1827821, which is invalid:

  • expected the bug to target the "4.4.0" release, but it targets "4.4.z" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@awgreene
Copy link
Member Author

awgreene commented May 4, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 4, 2020
@openshift-ci-robot
Copy link
Collaborator

@awgreene: This pull request references Bugzilla bug 1827821, 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.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.4.z) matches configured target release for branch (4.4.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
  • dependent bug Bugzilla bug 1818788 is in the state VERIFIED, which is one of the valid states (VERIFIED, RELEASE_PENDING, CLOSED (ERRATA))
  • dependent Bugzilla bug 1818788 targets the "4.5.0" release, which is one of the valid target releases: 4.5.0, 4.5.z
  • bug has dependents

In response to this:

/bugzilla refresh

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 removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label May 4, 2020
@kevinrizza
Copy link
Member

/lgtm

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

ecordell commented May 4, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awgreene, 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

@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 4, 2020
@sdodson sdodson added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label May 8, 2020
@openshift-bot
Copy link
Contributor

/retest

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

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit f8ef76c into operator-framework:release-4.4 May 8, 2020
@openshift-ci-robot
Copy link
Collaborator

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

In response to this:

Bug 1827821: Generation bug 4.4 Backport

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-cherrypick-robot

@awgreene: #1484 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/controller/registry/resolver/evolver.go
M	pkg/controller/registry/resolver/resolver_test.go
M	test/e2e/catalog_e2e_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/catalog_e2e_test.go
CONFLICT (content): Merge conflict in test/e2e/catalog_e2e_test.go
Auto-merging pkg/controller/registry/resolver/resolver_test.go
CONFLICT (content): Merge conflict in pkg/controller/registry/resolver/resolver_test.go
Auto-merging pkg/controller/registry/resolver/evolver.go
CONFLICT (content): Merge conflict in pkg/controller/registry/resolver/evolver.go
Patch failed at 0001 Fix Operator Generation code

In response to this:

/cherry-pick release-4.3

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-high Referenced Bugzilla bug's severity is high 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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants