-
Notifications
You must be signed in to change notification settings - Fork 551
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
[RFE] Add Channel to Operator Dependency Resolution #1557
Comments
Trying to follow along the logic here, isn't the dependency somewhat just orthogonal to the update channel that would be defined if you subscribed to that operator itself? When we resolve a dependency, that dependency doesn't automatically pull updates itself. It seems like, yes, while the version range >=1.1.2 can define a set of operators that are contained in multiple update channels, isn't ultimately what the operator author wants that they resolve their dependency with a version in that set? Or is the actual request that when you install an operator, its dependencies automatically get upgrades inside a specific upgrade channel orthogonal from semantic version or GVK entirely? |
It's the second: This is really about operator inception. When an Operator is initially installed and the dependent operator subscriptions are automatically created, the |
@cdjohnson Thanks for writing this up here. Just been taking some time to think about the problem. I'm concerned that dependencies that include specific channels will over-constrain the resolver more often than not. In other words, we'll never be able to resolve two constraints like this successfully: dependencies:
- type: olm.package
name: ibm-operator-iam
channel: V1.0-lts
---
dependencies:
- type: olm.package
name: ibm-operator-iam
channel: V1.0-fast even if there was some underling operator version present in both channels that could satisfy the real dependency being expressed. There seem to be two ways that people are using channels right now:
The ability to depend on version ranges of a particular package will make the version channels less appealing (there is no way to automatically bump a dependency between channels). But even when that happens there will be a set of packages/channels that will need to be handled from existing published packages. I would propose that we support both of the ways channels are being used explicitly, with well-defined behavior for each. This looks something like:
(This could be reduced to just the last 2 rules, with the first two being optimizations/enhancements on top). The example above follows neither the semver-based ordering nor the frequency ordering (it's a mix of both). This will need to fall back to ordering channels manually:
So that the dependency Another example: |
Just surfacing some internal discussions we've been having on this issue here to share how we are using dependencies and what the current behaviour means. We have a set of operators which together form a "Cloud Pak". All of these operators have a common dependency on another operator - let's call that CS. They include this dependency in their CSV as a required CRD. Some operators have other dependencies - e.g. Couch. These operators can be installed seperately or via an "uber-operator" which does not reconcile a CR as such but is purely a packaging exercise to include all the Cloud Pak operators as CSV dependencies for a single place a customer can install everything. Here are a couple of examples we call out in an internal issue where not being able to control the version of the dependency causes us problems: Example: One of our operators - let's call it AR depends on the Couch operator. When we ship, their default channel is v3.0.0. A week later they release v4.0.0 (but do not change the CRD version) and change their default channel. All existing installs of AR will potentially be modified to upgrade to the new version and any new install will use v4.0.0 too. This is a major version release and is likely to cause issues with our existing code. Most notably - we were not in control of when to take this new version to give us time to test, fix accordingly. Example 2: We consume the CS operator via an OLM dependency. The default channel is "stable". We want to develop the next release of our operator against the next release of CS which is being provided under the "dev" channel. We cannot specify we want this in our dependency and will always pick up "stable". We appreciate their are ways to workaround these by changing CRD versions etc. but the main point stands - we need to be able to control exactly what we are installing to guarantee behaviours for our customers |
@ecordell Where do you think the "weight" rules would be applied? In the Package where the Default Channel defined? Regarding Sam's use cases: dependencies:
- type: olm.package
name: couch
version: ">=3.0.0 <4.0.0 Example2: |
Leaving that somewhat unspecified for now so that we can discuss different options.
Is it reasonable to specify a little more during development? You can create the operator subscription and the CS Subscription at the same time, and specify the dev channel up front for CS. |
Hi @ecordell have the options for this been discussed? I'm looking to see whether there is an outlook for it? |
@darrensu-ibm We had a discussion at the operator-sdk olm dev sig meeting last week. See minutes. @njhale volunteered to collect all the internal Red Hat documentation on this topic and publish it in a google doc for us to consume, so we can create the right taxonomy here. Once we have that, we'll need to decide if using channel restrictions is appropriate or not when handling dependency resolution for first-time installations, or if we need a different approach. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contribution. |
This issue has been automatically closed because it has not had any recent activity. Thank you for your contribution. |
Feature Request
Problem
Today: All operators are resolved by GVK. If the API is stable among lots of versions and channels, the Operator that is created by an Automatic Subscription may not be the version that is Functionally compatible with the dependent operator.
There are other factors that go into satisfying the dependency:
Example channel taxonomy for IAM:
All versions have the same GVK.
The Operator Dependency Resolution enhancement adds to the GVK option by allowing an Operator Version to add a dependency on an Operator by Semver range.
This solves the problem when channels are divided properly in to X.Y channels, since you will always get the head of the correct channel.
Example of Semver Dependency declaration:
In the above example three different channels satisfy the requirement
Example of GVK Dependency declaration:
In the above example, ALL of the channels satisfy the requirement.
This does not solve the other use cases where the version and API are not the only consideration.
Suggested Implementation
To make it generic in nature, use the Channel to describe the dependency. For example, if the dependent operator is in an LTSR channel, the IAM dependency could choose the "default" compatible LTSR channel.
in the MQ V9.5.0 Bundle:
@kevinrizza @shawn-hurley @ecordell @dinhxuanvu
The text was updated successfully, but these errors were encountered: