-
Notifications
You must be signed in to change notification settings - Fork 54
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
✨ Integrate App with Extension reconciler #625
✨ Integrate App with Extension reconciler #625
Conversation
/hold Based on top of #598 |
7f3bdd3
to
9c5ae10
Compare
51fa95f
to
2c32a98
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #625 +/- ##
===========================================
- Coverage 78.91% 64.10% -14.82%
===========================================
Files 22 22
Lines 1148 1368 +220
===========================================
- Hits 906 877 -29
- Misses 192 441 +249
Partials 50 50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 PR adds a bunch of resolution code that I don't think we'll want in the long run.
Instead of bickering over it in this PR, what do you think about going ahead with a simple (as simple as you want it for now) filter/sort/pick highest approach?
I'd propose that in this PR, the simple filtering could just be "give me the highest version for the package is that is in the specified channel and range".
And then we could follow-up with a separate PR to handle the various upgrade concerns.
// TODO: Instead of using a SAT solver and generating variables based on installed and | ||
// available bundles, work on a filtering mechanism to evaluate if the bundle and its | ||
// APIs are installed on a cluster or not. Feature tracked in a separate issue. |
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 don't need to evaluate if the bundle and its APIs are already installed on the cluster.
For now, the "resolution" without deppy would be:
- Get package, channel, bundle info from catalogd for
ext.Spec.Source.Package.Name
- Set
candidates
to all the bundles in the package. - If
ext.Spec.Source.Package.Channel
is set, remove candidates unless they have anentries[].name
in the named channel. - If
ext.Spec.Source.Package.Version
is set, remove candidates unless their version is in the specified range. - If an
App
already exists for the Extension, remove candidates that are not the existing installed bundle or a successor of the existing installed bundle. (Ideally this would also account for UpgradeConstraintPolicy and the ForceSemver feature gate). - If no candidates remain, "resolution" fails
- Sort the remaining candidates by semver, and pick the highest.
So this is all just "grab from the catalog(s) and filter based on what's in the spec and what is installed"
Feel free to capture in a follow-up!
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've captured this for a follow up #654 and done basic filtering based on version, package and channel. Meanwhile, looking into the code, realized that we do have helpers in place to filter out catalog bundles based on relevant info from extension that currently deppy uses to create variables. We can re-use them to make filtering cleaner.
2c32a98
to
23e2661
Compare
Surprised that rukpak is breaking the tilt tests, which is not related to this PR at all. |
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.
Apart from a couple of nits, looks good!
23e2661
to
29cba63
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.
/lgtm
Seems like a great jumping off point! Just to sanity check I understood things properly. It looks like:
- If the kapp apis are installed after olm is, olm won't be aware of them unless you restart the pod manually
- We don't have a good way of knowing if the kapp apis will be reconciled
- The only thing this extension reconciler does is
- install plain bundles
- map these manifests to an app cr
- relay status of app cr back to extension api
Let me know if I misunderstood anything / if there's more I didn't see.
@gallettilance yes, you're right. Adding a few more thoughts:
The intention is to have kapp-controller setup along with relevant APIs during OLM installation itself. This is just an additional check just to ensure if kapp APIs are in place before we run the reconcile - since an independent installation is also possible and these are external APIs.
Could you elaborate more on this? If you meat the successful reconcile for an App CR - yeah, for now we are just relaying a ReconcileSuccessful status, but there is a follow up issue created to track other statuses - like reconcile failed, deleting etc.
This is mostly right, except that extension reconciler does not directly install bundles, instead it creates an App CR which triggers the kapp-controller to unpack and install bundles. Over all the flow looks like:
|
// originally Reason: ocv1alpha1.ReasonInstallationFailed | ||
ext.Status.InstalledBundleResource = "" | ||
setInstalledStatusConditionFailed(&ext.Status.Conditions, err.Error(), ext.GetGeneration()) |
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.
What if a previous App
is installed? It seems like we should be able to keep this status reflecting the truth of what's actually installed? This can be a follow-up.
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 existing app with the same spec exists, we will be returning with a nil error after doing the equality check: https://github.com/operator-framework/operator-controller/pull/625/files#diff-c04822d94b6cb8ff190859213d75fa6cd5c8b7c5284aaa2cf93cd504f727f5a9R363. After which we map the status of App we return from ensureApp
- which is going to be either the existing one or the patched one.
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.
But if we have a new spec (e.g. we're doing an upgrade), and we patch the App
, does the App
status have a dual indication of:
- Still have this old thing active
- Progressing on rolling out the new thing
It would be nice, for example, that if something failed during one of (fetch, template, preflight) we could tell Extension users that the previous version is still installed, but this upgrade needs some attention.
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 could tell Extension users that the previous version is still installed, but this upgrade needs some attention.
Upgrade scenario needs to be verified with kapp-controller. I think the App status still reflects "Reconciling", I don't see anything specific related to it in their status. Will create a follow up to look into it.
This commit introduces support for creating App CR in extension controller. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
29cba63
to
d7cd944
Compare
New changes are detected. LGTM label has been removed. |
66bfed6
to
744c54c
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.
Awesome PR @varshaprasad96! Thanks!
Did you ever figure out what was going on with that tilt job? I wonder if there's something that's just broken about it because of the passage of time and some non-pinned configuration of something?
operator-framework/rukpak#830 should fix it. Though I think we need a new release, because |
92a87d2
Description
This PR introduces support for installing App CR with extension reconciler.
Each of the TODOs below, will have a separate issue created:
Reviewer Checklist