Skip to content

Commit 39e7dd5

Browse files
authored
Fix docs: "Conceptual Guides" section (#1473)
There were several intentional breaking changes in the API which are now included in v0.18.0 release. This commit mostly focuses on updating the documentation to reflect API changes. This includes making sure that snippets and example outputs match the current state of the project. Relevant PRs: * #1439 * #1434 Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
1 parent f94182f commit 39e7dd5

File tree

4 files changed

+104
-72
lines changed

4 files changed

+104
-72
lines changed

docs/concepts/controlling-catalog-selection.md

Lines changed: 74 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ To select a specific catalog by name, you can use the `matchLabels` field in you
2121
apiVersion: olm.operatorframework.io/v1
2222
kind: ClusterExtension
2323
metadata:
24-
name: my-extension
24+
name: argocd
2525
spec:
26-
packageName: my-package
27-
catalog:
28-
selector:
29-
matchLabels:
30-
olm.operatorframework.io/metadata.name: my-content-management
26+
namespace: argocd
27+
serviceAccount:
28+
name: argocd-installer
29+
source:
30+
sourceType: Catalog
31+
catalog:
32+
packageName: argocd-operator
33+
selector:
34+
matchLabels:
35+
olm.operatorframework.io/metadata.name: operatorhubio
3136
```
3237
33-
In this example, only the catalog named `my-catalog` will be considered when resolving `my-package`.
38+
In this example, only the catalog named `operatorhubio` will be considered when resolving `argocd-operator`.
3439

3540
### Selecting Catalogs by Labels
3641

@@ -42,13 +47,18 @@ If you have catalogs labeled with specific metadata, you can select them using `
4247
apiVersion: olm.operatorframework.io/v1
4348
kind: ClusterExtension
4449
metadata:
45-
name: my-extension
50+
name: argocd
4651
spec:
47-
packageName: my-package
48-
catalog:
49-
selector:
50-
matchLabels:
51-
example.com/support: "true"
52+
namespace: argocd
53+
serviceAccount:
54+
name: argocd-installer
55+
source:
56+
sourceType: Catalog
57+
catalog:
58+
packageName: argocd-operator
59+
selector:
60+
matchLabels:
61+
example.com/support: "true"
5262
```
5363

5464
This selects catalogs labeled with `example.com/support: "true"`.
@@ -59,17 +69,22 @@ This selects catalogs labeled with `example.com/support: "true"`.
5969
apiVersion: olm.operatorframework.io/v1
6070
kind: ClusterExtension
6171
metadata:
62-
name: my-extension
72+
name: argocd
6373
spec:
64-
packageName: my-package
65-
catalog:
66-
selector:
67-
matchExpressions:
68-
- key: example.com/support
69-
operator: In
70-
values:
71-
- "gold"
72-
- "platinum"
74+
namespace: argocd
75+
serviceAccount:
76+
name: argocd-installer
77+
source:
78+
sourceType: Catalog
79+
catalog:
80+
packageName: argocd-operator
81+
selector:
82+
matchExpressions:
83+
- key: example.com/support
84+
operator: In
85+
values:
86+
- "gold"
87+
- "platinum"
7388
```
7489

7590
This selects catalogs where the label `example.com/support` has the value `gold` or `platinum`.
@@ -84,16 +99,21 @@ You can exclude catalogs by using the `NotIn` or `DoesNotExist` operators in `ma
8499
apiVersion: olm.operatorframework.io/v1
85100
kind: ClusterExtension
86101
metadata:
87-
name: my-extension
102+
name: argocd
88103
spec:
89-
packageName: my-package
90-
catalog:
91-
selector:
92-
matchExpressions:
93-
- key: olm.operatorframework.io/metadata.name
94-
operator: NotIn
95-
values:
96-
- unwanted-content-management
104+
namespace: argocd
105+
serviceAccount:
106+
name: argocd-installer
107+
source:
108+
sourceType: Catalog
109+
catalog:
110+
packageName: argocd-operator
111+
selector:
112+
matchExpressions:
113+
- key: olm.operatorframework.io/metadata.name
114+
operator: NotIn
115+
values:
116+
- unwanted-catalog
97117
```
98118

99119
This excludes the catalog named `unwanted-catalog` from consideration.
@@ -104,14 +124,19 @@ This excludes the catalog named `unwanted-catalog` from consideration.
104124
apiVersion: olm.operatorframework.io/v1
105125
kind: ClusterExtension
106126
metadata:
107-
name: my-extension
127+
name: argocd
108128
spec:
109-
packageName: my-package
110-
catalog:
111-
selector:
112-
matchExpressions:
113-
- key: example.com/support
114-
operator: DoesNotExist
129+
namespace: argocd
130+
serviceAccount:
131+
name: argocd-installer
132+
source:
133+
sourceType: Catalog
134+
catalog:
135+
packageName: argocd-operator
136+
selector:
137+
matchExpressions:
138+
- key: example.com/support
139+
operator: DoesNotExist
115140
```
116141

117142
This selects catalogs that do not have the `example.com/support` label.
@@ -200,11 +225,16 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
200225
metadata:
201226
name: install-my-operator
202227
spec:
203-
packageName: my-operator
204-
catalog:
205-
selector:
206-
matchLabels:
207-
example.com/support: "true"
228+
namespace: my-operator-ns
229+
serviceAccount:
230+
name: my-operator-installer
231+
source:
232+
sourceType: Catalog
233+
catalog:
234+
packageName: my-operator
235+
selector:
236+
matchLabels:
237+
example.com/support: "true"
208238
```
209239

210240
3. **Apply the Resources**

docs/concepts/crd-upgrade-safety.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,26 @@ not cause the CRD Upgrade Safety preflight check to halt the upgrade:
5353
## Disabling CRD Upgrade Safety
5454

5555
The CRD Upgrade Safety preflight check can be entirely disabled by adding the
56-
`preflight.crdUpgradeSafety.disabled` field with a value of "true" to the ClusterExtension of the CRD.
56+
`.spec.install.preflight.crdUpgradeSafety.enforcement` field with a value of `None` to the `ClusterExtension` of the CRD.
5757

5858
```yaml
5959
apiVersion: olm.operatorframework.io/v1
6060
kind: ClusterExtension
6161
metadata:
62-
name: clusterextension-sample
62+
name: argocd
6363
spec:
64-
source:
65-
sourceType: Catalog
66-
catalog:
67-
packageName: argocd-operator
68-
version: 0.6.0
69-
install:
70-
namespace: default
71-
serviceAccount:
72-
name: argocd-installer
73-
preflight:
74-
crdUpgradeSafety:
75-
disabled: true
64+
namespace: argocd
65+
serviceAccount:
66+
name: argocd-installer
67+
source:
68+
sourceType: Catalog
69+
catalog:
70+
packageName: argocd-operator
71+
version: 0.6.0
72+
install:
73+
preflight:
74+
crdUpgradeSafety:
75+
enforcement: None
7676
```
7777
7878
You cannot disable individual field validators. If you disable the CRD Upgrade Safety preflight check, all field validators are disabled.

docs/concepts/upgrade-support.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It also introduces an API to enable independently verified upgrades and downgrad
1515

1616
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.
1717

18-
By supporting legacy OLM semantics, OLM v1 now honors the upgrade graph from catalogs accurately.
18+
By supporting legacy OLM semantics, OLM v1 honors the upgrade graph from catalogs accurately.
1919

2020
If there are multiple possible successors, OLM v1 behavior differs in the following ways:
2121

@@ -29,7 +29,7 @@ Consider the following set of file-based catalog (FBC) channel entries:
2929
- name: example.v3.0.0
3030
skips: ["example.v2.0.0"]
3131
- name: example.v2.0.0
32-
skipRange: >=1.0.0 <2.0.0
32+
skipRange: ">=1.0.0 <2.0.0"
3333
```
3434
3535
If `1.0.0` is installed, OLM v1 behavior differs in the following ways:
@@ -39,18 +39,21 @@ If `1.0.0` is installed, OLM v1 behavior differs in the following ways:
3939

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

42-
``` yaml hl_lines="10"
42+
``` yaml hl_lines="14"
4343
apiVersion: olm.operatorframework.io/v1
4444
kind: ClusterExtension
4545
metadata:
4646
name: <extension_name>
4747
spec:
48-
installNamespace: <namespace>
49-
packageName: <package_name>
48+
namespace: <namespace>
5049
serviceAccount:
5150
name: <service_account>
52-
upgradeConstraintPolicy: SelfCertified
53-
version: "<version_or_version_range>"
51+
source:
52+
sourceType: Catalog
53+
catalog:
54+
packageName: <package_name>
55+
version: "<version_or_version_range>"
56+
upgradeConstraintPolicy: SelfCertified
5457
```
5558

5659
Setting the `upgradeConstraintPolicy` to:
@@ -82,26 +85,25 @@ You must verify and perform upgrades manually in cases where automatic upgrades
8285
!!! warning
8386
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.
8487

85-
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 `SelfCertified` on the relevant `ClusterExtension` resource.
88+
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.source.catalog.upgradeConstraintPolicy` field to `SelfCertified` on the relevant `ClusterExtension` resource.
8689

8790
If you set the field to `SelfCertified`, 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.
8891

89-
Example `ClusterExtension` with `.spec.upgradeConstraintPolicy` field set to `SelfCertified`:
92+
Example `ClusterExtension` with `.spec.source.catalog.upgradeConstraintPolicy` field set to `SelfCertified`:
9093

9194
```yaml
9295
apiVersion: olm.operatorframework.io/v1
9396
kind: ClusterExtension
9497
metadata:
9598
name: extension-sample
9699
spec:
100+
namespace: argocd
101+
serviceAccount:
102+
name: argocd-installer
97103
source:
98104
sourceType: Catalog
99105
catalog:
100106
packageName: argocd-operator
101107
version: 0.6.0
102108
upgradeConstraintPolicy: SelfCertified
103-
install:
104-
namespace: argocd
105-
serviceAccout:
106-
name: argocd-installer
107109
```

docs/concepts/version-ranges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You define a version range by adding a comparison string to the `spec.version` f
3131
To specify a version range, use a range comparison similar to the following example:
3232

3333
```yaml
34-
version: >=3.0, <3.6
34+
version: ">=3.0, <3.6"
3535
```
3636
3737
#### Wildcards in comparisons

0 commit comments

Comments
 (0)