-
Notifications
You must be signed in to change notification settings - Fork 54
/
catalog-queries.md
72 lines (55 loc) · 2.1 KB
/
catalog-queries.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Catalog queries
**Note:** By default, Catalogd is installed with TLS enabled for the catalog webserver.
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.
You can use the `curl` command with `jq` to query catalogs that are installed on your cluster.
``` terminal title="Query syntax"
curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | <query>
```
## Package queries
Available packages in a catalog
:
``` terminal
jq -s '.[] | select( .schema == "olm.package")'
```
Packages that support `AllNamespaces` install mode and do not use webhooks
:
``` terminal
jq -c 'select(.schema == "olm.bundle") | {"package":.package, "version":.properties[] | select(.type == "olm.bundle.object").value.data | @base64d | fromjson | select(.kind == "ClusterServiceVersion" and (.spec.installModes[] | select(.type == "AllNamespaces" and .supported == true) != null) and .spec.webhookdefinitions == null).spec.version}'
```
Package metadata
:
``` terminal
jq -s '.[] | select( .schema == "olm.package") | select( .name == "<package_name>")'
```
Catalog blobs in a package
:
``` terminal
jq -s '.[] | select( .package == "<package_name>")'
```
## Channel queries
Channels in a package
:
``` terminal
jq -s '.[] | select( .schema == "olm.channel" ) | select( .package == "<package_name>") | .name'
```
Versions in a channel
:
``` terminal
jq -s '.[] | select( .package == "<package_name>" ) | select( .schema == "olm.channel" ) | select( .name == "<channel_name>" ) | .entries | .[] | .name'
```
Latest version in a channel and upgrade path
:
``` terminal
jq -s '.[] | select( .schema == "olm.channel" ) | select ( .name == "<channel>") | select( .package == "<package_name>")'
```
## Bundle queries
Bundles in a package
:
``` terminal
jq -s '.[] | select( .schema == "olm.bundle" ) | select( .package == "<package_name>") | .name'
```
Bundle dependencies and available APIs
:
``` terminal
jq -s '.[] | select( .schema == "olm.bundle" ) | select ( .name == "<bundle_name>") | select( .package == "<package_name>")'
```