Skip to content

Commit 9c5c3ca

Browse files
bentitom1kola
andauthored
📖 Simplify jq examples using olm.csv.metadata (#1464)
* Simplify jq examples using olm.csv.metadata Signed-off-by: Brett Tofel <btofel@redhat.com> * Fix formatting lost in rebase Co-authored-by: Mikalai Radchuk <509198+m1kola@users.noreply.github.com> --------- Signed-off-by: Brett Tofel <btofel@redhat.com> Co-authored-by: Mikalai Radchuk <509198+m1kola@users.noreply.github.com>
1 parent eb6b83d commit 9c5c3ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/howto/catalog-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | <query>
3535
3636
* Packages that support `AllNamespaces` install mode and do not use webhooks:
3737
``` terminal
38-
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}'
38+
jq -cs '[.[] | select(.schema == "olm.bundle" and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] | select(.type == "AllNamespaces" and .supported == true)) and .spec.webhookdefinitions == null) | .package] | unique[]'
3939
```
4040
4141
* Package metadata:

docs/tutorials/explore-available-content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Then you can query the catalog by using `curl` commands and the `jq` CLI tool to
9797
3. Return list of packages that support `AllNamespaces` install mode and do not use webhooks:
9898
9999
``` terminal
100-
curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | 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}'
100+
curl -k https://localhost:8443/catalogs/operatorhubio/api/v1/all | jq -cs '[.[] | select(.schema == "olm.bundle" and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] | select(.type == "AllNamespaces" and .supported == true)) and .spec.webhookdefinitions == null) | .package] | unique[]'
101101
```
102102
103103
??? success

0 commit comments

Comments
 (0)