Skip to content

Commit 7bd4e73

Browse files
author
Mikalai Radchuk
committed
Fix docs: "How to" section
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: * operator-framework#1439 * operator-framework#1434 Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 56f5342 commit 7bd4e73

File tree

5 files changed

+67
-25
lines changed

5 files changed

+67
-25
lines changed

docs/howto/catalog-queries.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
# Catalog queries
22

3+
After you [add a catalog of extensions](../tutorials/add-catalog.md) to your cluster, you must port forward your catalog as a service.
4+
Then you can query the catalog by using `curl` commands and the `jq` CLI tool to find extensions to install.
5+
6+
## Prerequisites
7+
8+
* You have added a ClusterCatalog of extensions, such as [OperatorHub.io](https://operatorhub.io), to your cluster.
9+
* You have installed the `jq` CLI tool.
10+
311
!!! note
412
By default, Catalogd is installed with TLS enabled for the catalog webserver.
513
The following examples will show this default behavior, but for simplicity's sake will ignore TLS verification in the curl commands using the `-k` flag.
614

15+
You also need to port forward the catalog server service:
16+
17+
``` terminal
18+
kubectl -n olmv1-system port-forward svc/catalogd-service 8443:443
19+
```
720

8-
You can use the `curl` command with `jq` to query catalogs that are installed on your cluster.
21+
Now you can use the `curl` command with `jq` to query catalogs that are installed on your cluster.
922

1023
``` terminal title="Query syntax"
1124
curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | <query>
1225
```
26+
`<query>`
27+
: One of the `jq` queries from this document
1328

1429
## Package queries
1530

@@ -28,36 +43,66 @@ curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | <query>
2843
jq -s '.[] | select( .schema == "olm.package") | select( .name == "<package_name>")'
2944
```
3045
46+
`<package_name>`
47+
: Name of the package from the catalog you are querying.
48+
3149
* Catalog blobs in a package:
3250
``` terminal
3351
jq -s '.[] | select( .package == "<package_name>")'
3452
```
3553
54+
`<package_name>`
55+
: Name of the package from the catalog you are querying.
56+
3657
## Channel queries
3758
3859
* Channels in a package:
3960
``` terminal
4061
jq -s '.[] | select( .schema == "olm.channel" ) | select( .package == "<package_name>") | .name'
4162
```
4263
64+
`<package_name>`
65+
: Name of the package from the catalog you are querying.
66+
4367
* Versions in a channel:
4468
``` terminal
4569
jq -s '.[] | select( .package == "<package_name>" ) | select( .schema == "olm.channel" ) | select( .name == "<channel_name>" ) | .entries | .[] | .name'
4670
```
4771
72+
`<package_name>`
73+
: Name of the package from the catalog you are querying.
74+
75+
`<channel_name>`
76+
: Name of the channel for a given package.
77+
4878
* Latest version in a channel and upgrade path:
4979
``` terminal
50-
jq -s '.[] | select( .schema == "olm.channel" ) | select ( .name == "<channel>") | select( .package == "<package_name>")'
80+
jq -s '.[] | select( .schema == "olm.channel" ) | select ( .name == "<channel_name>") | select( .package == "<package_name>")'
5181
```
5282
83+
`<package_name>`
84+
: Name of the package from the catalog you are querying.
85+
86+
`<channel_name>`
87+
: Name of the channel for a given package.
88+
5389
## Bundle queries
5490
5591
* Bundles in a package:
5692
``` terminal
5793
jq -s '.[] | select( .schema == "olm.bundle" ) | select( .package == "<package_name>") | .name'
5894
```
5995
96+
`<package_name>`
97+
: Name of the package from the catalog you are querying.
98+
6099
* Bundle dependencies and available APIs:
61100
``` terminal
62101
jq -s '.[] | select( .schema == "olm.bundle" ) | select ( .name == "<bundle_name>") | select( .package == "<package_name>")'
63102
```
103+
104+
`<package_name>`
105+
: Name of the package from the catalog you are querying.
106+
107+
`<bundle_name>`
108+
: Name of the bundle for a given package.

docs/howto/how-to-channel-based-upgrades.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ kind: ClusterExtension
1010
metadata:
1111
name: argocd
1212
spec:
13+
namespace: argocd
14+
serviceAccount:
15+
name: argocd-installer
1316
source:
1417
sourceType: Catalog
1518
catalog:
1619
packageName: argocd-operator
1720
# Automatically upgrade to the latest version found in the preview and dev-preview channels
1821
channels: [dev-preview, preview]
19-
install:
20-
namespace: argocd
21-
serviceAccount:
22-
name: argocd-installer
2322
```
2423
25-
Note that the `version` field also accepts a version range to further restrict the set of possible upgradable operator versions.
24+
Note that the `version` field also supports [version pinning](./how-to-pin-version.md) and [version ranges](./how-to-version-range-upgrades.md) to further restrict the set of possible upgradable operator versions.
2625

2726
Example:
2827

@@ -32,14 +31,15 @@ kind: ClusterExtension
3231
metadata:
3332
name: argocd
3433
spec:
34+
namespace: argocd
35+
serviceAccount:
36+
name: argocd-installer
3537
source:
3638
sourceType: Catalog
3739
catalog:
3840
packageName: argocd-operator
3941
channels: [stable] # Automatically upgrade to the latest version found in ‘stable’
40-
version: “!1.3.2” # Don’t allow version 1.3.2
41-
install:
42-
namespace: argocd
43-
serviceAccount:
44-
name: argocd-installer
42+
version: "!=1.3.2" # Don’t allow version 1.3.2
4543
```
44+
45+
For more information on SemVer version ranges see [version ranges](../concepts/version-ranges.md)

docs/howto/how-to-pin-version.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ kind: ClusterExtension
1010
metadata:
1111
name: argocd
1212
spec:
13+
namespace: argocd
14+
serviceAccount:
15+
name: argocd-installer
1316
source:
1417
sourceType: Catalog
1518
catalog:
1619
packageName: argocd-operator
1720
version: 0.6.0 # Pin argocd-operator to v0.6.0
18-
install:
19-
namespace: argocd
20-
serviceAccount:
21-
name: argocd-installer
2221
```
2322
2423
For more information on SemVer version ranges see [version ranges](../concepts/version-ranges.md)

docs/howto/how-to-version-range-upgrades.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ kind: ClusterExtension
1010
metadata:
1111
name: argocd
1212
spec:
13+
namespace: argocd
14+
serviceAccount:
15+
name: argocd-installer
1316
source:
1417
sourceType: Catalog
1518
catalog:
1619
packageName: argocd-operator
1720
version: ">=3.0, <3.6" # Install versions from v3.0.0 up to, but not including, v3.6.0
18-
install:
19-
namespace: argocd
20-
serviceAccount:
21-
name: argocd-installer
2221
```
2322
2423
For more information on SemVer version ranges see [version-ranges](../concepts/version-ranges.md)

docs/howto/how-to-z-stream-upgrades.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ kind: ClusterExtension
1010
metadata:
1111
name: argocd
1212
spec:
13+
namespace: argocd
14+
serviceAccount:
15+
name: argocd-installer
1316
source:
1417
sourceType: Catalog
1518
catalog:
1619
packageName: argocd-operator
17-
version: “~2.3" # Automatically upgrade patch releases for v2.3
18-
install:
19-
namespace: argocd
20-
serviceAccount:
21-
name: argocd-installer
20+
version: "~2.3" # Automatically upgrade patch releases for v2.3
2221
```
2322
2423
For more information on SemVer version ranges see [version ranges](../concepts/version-ranges.md)

0 commit comments

Comments
 (0)