Skip to content
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

Bug 1732914: Operator upgrades fail when versions field is not set #973

Merged

Conversation

dinhxuanvu
Copy link
Member

  1. Fix the ensureCRDVersions to account for version field
  2. Add test cases for version scenarios

Signed-off-by: Vu Dinh vdinh@redhat.com

@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 Aug 1, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references a valid Bugzilla bug. 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.

In response to this:

Bug 1732914: Operator upgrades fail when versions field is not set

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 added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 1, 2019
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.

Thanks for fixing this @dinhxuanvu. Looks like the only thing left is an e2e test verifying the fix.

Also, I don't think we need to fix this now, but the current logic doesn't leave room for API deprecation - We should probably think about how we want to handle that soon.

cc @ecordell

if oldVersion.Name == newVersion.Name {
versionPresent = true
}
newCRDVersions := map[string]struct{}{}
Copy link
Member

@ecordell ecordell Aug 12, 2019

Choose a reason for hiding this comment

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

Is the behavior that we want here actually something like:

  1. There must be a nonempty intersection of oldCRDVersions and newCRDVersions
  2. For any version in both oldCRD and newCRD, ensure the validation is unchanged (or has only backwards-compatible changes)

I'm thinking that this used as-is will prevent anyone from ever deprecating an older api version. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Developers can deprecate/disable a version of CRD by simply changing Served field into false. The reason I think we shouldn't allow developers to remove a version straight out without at least disabling it first to avoid the confusion that a CSV may reference that version or an existing CR with that version but the new CRD has no record of that version. Also, if a CSV is still referencing to a version that is not present in new CRD, the InstallPlan won't include a step to upgrade that CRD.

Copy link
Member

Choose a reason for hiding this comment

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

I would like to make sure that this is documented. Can we add some doc's in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

@shawn-hurley The doc PR is referenced in this PR. It is #984.

@rthallisey
Copy link

will this change be back ported to 4.2?

@dinhxuanvu
Copy link
Member Author

dinhxuanvu commented Aug 14, 2019

@rthallisey This is 4.2 bug fix so it should be in 4.2.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 15, 2019
1. Fix the ensureCRDVersions to account for `version` field
2. Add test cases for `version` scenarios

Signed-off-by: Vu Dinh <vdinh@redhat.com>
@ecordell
Copy link
Member

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2019
@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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2019
@dinhxuanvu
Copy link
Member Author

/retest

5 similar comments
@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

6 similar comments
@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 3b383b7 into operator-framework:master Aug 22, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: All pull requests linked via external trackers have merged. Bugzilla bug 1732914 has been moved to the MODIFIED state.

In response to this:

Bug 1732914: Operator upgrades fail when versions field is not set

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/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. CRD Versioning lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants