-
Notifications
You must be signed in to change notification settings - Fork 544
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 1723818: CSV name change should not cause upgrade to fail #925
Bug 1723818: CSV name change should not cause upgrade to fail #925
Conversation
6f0d5b6
to
22ce783
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.
🎉 I think you're on the right track! A few thoughts on what's here:
- Be careful of the additional adoptability checks during APIService install and installation checking. In the future, it may be better to consolidate these checks (maybe in an implementation of Operator validation library project proposal #924 extended to include APIServices).
- I think we also want to make the latest version of the OLM CSV in
./manifests
replaces the previous CSV. - @ecordell and I were talking about making OLM detect and apply CSV deployment spec changes at runtime, which may circumvent the issue packageserver is encountering that spurred this fix PR.
continue | ||
} | ||
|
||
if currentOwnerCSV.Status.Phase == v1alpha1.CSVPhaseReplacing || |
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 will allow any CSV to adopt an APIService from a CSV being replaced or deleted. This is not necessarily what we want. For example: APIService-A
is owned by CSV-A
and is being replaced by CSV-B
, which also provides APIService-A
. Concurrently, there exists a CSV-C
that provides APIService-A
as well. In this scenario, OLM would falsely determine that APIService-A
is adoptable by CSV-B
- I may be missing something though.
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.
CSV-C
either currently owns APIService-A
or is trying to own it. If CSV-C
currently owns it and is not being replaced or being deleted then the function will not allow CSV-B
to take ownership. In the latter case where CSV-C
is also trying to own it then it's a race to the ownership.
} | ||
|
||
// Is it owned by this csv or the one it replaces. | ||
if ownerutil.AdoptableLabels(apiService.GetLabels(), true, owners...) { |
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.
If you check the owner for existence before this, and add it to the owners
slice if it's not found, then you should be able to drop the rest of this function.
/retest |
/retest |
If a head CSV has a different name than the CSV it replaces, upgrade fails because olm fails to transfer ownership of the APIService from the previous CSV to the head CSV. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1723818
@tkashem: This pull request references a valid Bugzilla bug. The bug has been moved to the POST state. In response to this:
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. |
/retest |
1 similar comment
/retest |
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
I left some comments that we should follow up on, but this looks good in general. I believe this will fix the linked bug and we won't have to merge the PR to remove the ClusterOperator for packageserver.
return | ||
} | ||
|
||
if err := ownerutil.InferGroupVersionKind(target); 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.
We know the type coming in and don't need the rest of the meta (just the kind string) - I would just import the ClusterServiceVersionKind
string from the api package and compare
if ownerKind != v1alpha1.ClusterServiceVersionKind { ... }
owners = append(owners, replacing) | ||
} | ||
if currentOwnerCSV != nil && ( | ||
currentOwnerCSV.Status.Phase == v1alpha1.CSVPhaseReplacing || currentOwnerCSV.Status.Phase == v1alpha1.CSVPhaseDeleting) { |
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 believe there's a set of phases that include these that you can check for membership
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, tkashem 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 |
Looks like it’s still failing: Jun 29 02:57:43.223: INFO: cluster upgrade is Progressing: Unable to apply 4.2.0-0.ci-2019-06-28-191017: the cluster operator operator-lifecycle-manager-packageserver has not yet successfully rolled out |
If a head CSV has a different name than the CSV it replaces, upgrade
fails because olm fails to transfer ownership of the APIService from
the previous CSV to the head CSV.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1723818