Skip to content

Commit db98441

Browse files
Mikalai Radchukmichaelryanpeter
andcommitted
Draft documentation for initial upgrade support
Signed-off-by: Mikalai Radchuk <[email protected]> Co-authored-by: Michael Peter <[email protected]>
1 parent b13e55c commit db98441

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Upgrade support
2+
3+
This document explains how OLM 1.0 handles upgrades.
4+
5+
OLM 1.0 introduces a simplified UX for package authors and package admins to implicitly define upgrade edges via [Semantic Versioning](https://semver.org/).
6+
7+
It also introduces an API to enable independently verified upgrades and downgrades.
8+
9+
## Upgrade constraint semantics
10+
11+
As of Operator Controller version 0.x, OLM 1.0 supports the following upgrade constraint semantics:
12+
13+
* [Semantic Versioning](https://semver.org/) (Semver)
14+
* The `replaces` directive from the [legacy OLM 0 semantics](https://olm.operatorframework.io/docs/concepts/olm-architecture/operator-catalog/creating-an-update-graph/#methods-for-specifying-updates)
15+
16+
The Kubernetes manifests in this repo enable Semver support by default. Cluster admins can control which semantics to use by passing one of the following arguments to the `manager` binary:
17+
* `--feature-gates=ForceSemverUpgradeConstraints=true` - enable Semver
18+
* `--feature-gates=ForceSemverUpgradeConstraints=false` - disable Semver, use legacy semantics
19+
20+
For example, to enable Semver:
21+
22+
```bash
23+
manager --feature-gates=ForceSemverUpgradeConstraints=true
24+
```
25+
26+
And to disable it:
27+
28+
```bash
29+
manager --feature-gates=ForceSemverUpgradeConstraints=false
30+
```
31+
32+
33+
## Upgrades
34+
35+
OLM supports Semver to provide a simplified way for package authors to define compatible upgrades. According to the Semver standard, releases within a major version (e.g. `>=1.0.0 <2.0.0`) must be compatible. As a result, package authors can publish a new package version following the Semver specification, and OLM assumes compatibility. Package authors do not have to explicitly define upgrade edges in the catalog.
36+
37+
**Note:** Currently, OLM 1.0 does not support automatic upgrades to the next major version. You must manually verify and perform major version upgrades. For more information about major version upgrades, see [Manually verified upgrades and downgrades](#manually-verified-upgrades-and-downgrades).
38+
39+
### Upgrades within the major version zero
40+
41+
According to the Semver specification, a major version zero release is for initial development. It is assumed that breaking changes might be introduced at any time. As a result, the following special conditions apply to upgrades within a major version zero release:
42+
43+
* You cannot automatically upgrade from one patch version to another when both major and minor versions are `0`. For example, automatic upgrades within the following version range are not allowed: `>= 0.0.1 <0.1.0`.
44+
* You cannot automatically upgrade from one minor version to another minor version within the major version zero. For example, no upgrades from `0.1.0` to `0.2.0`. However, you can upgrade from patch versions. For example, upgrades are possible in ranges `>= 0.1.0 <0.2.0`, `>= 0.2.0 <0.3.0`, `>= 0.3.0 <0.4.0`, and so on.
45+
46+
You must verify and perform upgrades manually in cases where automatic upgrades are blocked.
47+
48+
## Manually verified upgrades and downgrades
49+
50+
**Warning:** If you want to force an upgrade manually, you must thoroughly verify the outcome before applying any changes to production workloads. Failure to test and verify the upgrade might lead to catastrophic consequences such as data loss.
51+
52+
As a package admin, if you must upgrade or downgrade to version that might be incompatible with the currently installed version, you can set the `.spec.upgradeConstraintPolicy` field to `Ignore` on the relevant `Operator` resource.
53+
54+
If you set the field to `Ignore`, no upgrade constraints are set on the package. As a result, you can change the version to any version available in the catalogs for a given package.

0 commit comments

Comments
 (0)