Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 41 additions & 16 deletions docs/drafts/upgrade-support.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,58 @@
# Upgrade support

This document explains how OLM 1.0 handles upgrades.
This document explains how OLM v1 handles upgrades.

OLM 1.0 introduces a simplified UX for package authors and package admins to implicitly define upgrade edges via [Semantic Versioning](https://semver.org/).
OLM v1 introduces a simplified UX for package authors and package admins to implicitly define upgrade edges via [Semantic Versioning](https://semver.org/).

It also introduces an API to enable independently verified upgrades and downgrades.

## Upgrade constraint semantics

As of operator-controller release 0.10.0, OLM 1.0 supports the following upgrade constraint semantics:
When determining upgrade edges, also known as upgrade paths or upgrade constraints, for an installed cluster extension, Operator Lifecycle Manager (OLM) v1 supports [legacy OLM semantics](https://olm.operatorframework.io/docs/concepts/olm-architecture/operator-catalog/creating-an-update-graph/) by default. This support follows the behavior from legacy OLM, including `replaces`, `skips`, and `skipRange` directives, with a few noted differences.

* [Semantic Versioning](https://semver.org/) (Semver)
* [Legacy OLM 0 semantics](https://olm.operatorframework.io/docs/concepts/olm-architecture/operator-catalog/creating-an-update-graph/#methods-for-specifying-updates): the `replaces`/`skips`/`skipRange` directives
By supporting legacy OLM semantics, OLM v1 now honors the upgrade graph from catalogs accurately.

The Kubernetes manifests in this repo enable legacy support by default. Cluster admins can control which semantics to use by passing one of the following arguments to the `manager` binary:
* `--feature-gates=ForceSemverUpgradeConstraints=true` - enable Semver
* `--feature-gates=ForceSemverUpgradeConstraints=false` - disable Semver, use legacy semantics
* If there are multiple possible successors, OLM v1 behavior differs in the following ways:
* In legacy OLM, the successor closest to the channel head is chosen.
* In OLM v1, the successor with the highest semantic version (semver) is chosen.
* Consider the following set of file-based catalog (FBC) channel entries:

For example, to enable Semver update the `controller-manager` Deployment manifest to include the following argument:
```yaml
# ...
- name: example.v3.0.0
skips: ["example.v2.0.0"]
- name: example.v2.0.0
skipRange: >=1.0.0 <2.0.0
```
```yaml
- command:
- /manager
args:
- --feature-gates=ForceSemverUpgradeConstraints=true
image: controller:latest
If `1.0.0` is installed, OLM v1 behavior differs in the following ways:

* Legacy OLM does not detect an upgrade edge to `v2.0.0` because `v2.0.0` is skipped and not on the `replaces` chain.
* OLM v1 detects the upgrade edge because OLM v1 does not have a concept of a `replaces` chain. OLM v1 finds all entries that have a `replace`, `skip`, or `skipRange` value that covers the currently installed version.

You can change the default behavior of the upgrade constraints by setting the `upgradeConstraintPolicy` parameter in your cluster extension's custom resource (CR).

``` yaml hl_lines="10"
apiVersion: olm.operatorframework.io/v1alpha1
kind: ClusterExtension
metadata:
name: <extension_name>
spec:
installNamespace: <namespace>
packageName: <package_name>
serviceAccount:
name: <service_account>
upgradeConstraintPolicy: Ignore
version: "<version_or_version_range>"
Comment on lines +41 to +46
Copy link
Member

@joelanford joelanford Sep 4, 2024

Choose a reason for hiding this comment

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

Non-blocking (I think we'll need to sweep the entire repo once all the API changes are finished): All these fields are getting moved around:

Copy link
Contributor Author

@michaelryanpeter michaelryanpeter Sep 4, 2024

Choose a reason for hiding this comment

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

With Material MK Docs, we can actually embed YAML files into a markdown file.

Maybe we can create an issue right before or after 1.0.0 GA to switch our inline examples to embedded YAML files? That way we can update our examples all in one go.

Copy link
Contributor Author

@michaelryanpeter michaelryanpeter Sep 4, 2024

Choose a reason for hiding this comment

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

It looks like #1200 has the relevant doc changes already queued up.

Copy link
Member

Choose a reason for hiding this comment

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

#1200 merged, which makes this section incorrect if it merges. I'm happy to merge this and fix in a follow up (hence my approval on the PR), but I'll defer to you if you want to go ahead and fix now.

```

In a future release, it is planned to remove the `ForceSemverUpgradeConstraints` feature gate and allow package authors to specify upgrade constraint semantics at the catalog level.
where setting the `upgradeConstraintPolicy` to:

`Ignore`
: Does not limit the next version to the set of successors, and instead allows for any downgrade, sidegrade, or upgrade.

`Enforce`
Comment on lines +51 to +54
Copy link
Member

Choose a reason for hiding this comment

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

Another upcoming change: #1151

Copy link
Contributor Author

@michaelryanpeter michaelryanpeter Sep 4, 2024

Choose a reason for hiding this comment

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

@joelanford Do you want to change to the new value now? Or should we to update #1151 with a comment or a docs issue?

Copy link
Member

Choose a reason for hiding this comment

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

Use what you have, which is what is on main. The PR for that change should hopefully find/replace these.

: Only allows the next version to come from the successors list. This is the default value. If the `upgradeConstraintPolicy` parameter is not defined in an extension's CR, then the policy is set to `Enforce` by default.

## Upgrades

Expand Down