Skip to content

Commit cb9af75

Browse files
committed
add metas query info to tutorials, demos
Signed-off-by: Jordan Keister <[email protected]>
1 parent e4e76d2 commit cb9af75

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Welcome to the catalogd metas API endpoint demo
4+
#
5+
trap 'trap - SIGTERM && kill -- -"$$"' SIGINT SIGTERM EXIT
6+
7+
kind delete cluster
8+
kind create cluster
9+
kubectl cluster-info --context kind-kind
10+
sleep 10
11+
12+
# use the install script from the latest github release
13+
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash
14+
15+
# inspect crds (clustercatalog)
16+
kubectl get crds -A
17+
kubectl get clustercatalog -A
18+
19+
# ... checking catalogd controller is available
20+
kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controller-manager --timeout=1m
21+
22+
# patch the deployment to include the feature gate
23+
kubectl patch -n olmv1-system deploy/catalogd-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=APIV1MetasHandler=true"}]'
24+
25+
# ... waiting for new deployment for catalogd controller to become available
26+
kubectl rollout status -n olmv1-system deploy/catalogd-controller-manager
27+
# ... checking clustercatalog is serving
28+
kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s
29+
# ... checking clustercatalog is finished unpacking
30+
kubectl wait --for=condition=Progressing=False clustercatalog/operatorhubio --timeout=60s
31+
32+
33+
# port forward the catalogd-service service to interact with the HTTP server serving catalog contents
34+
(kubectl -n olmv1-system port-forward svc/catalogd-service 8081:443)&
35+
36+
sleep 3
37+
38+
# check what 'packages' are available in this catalog
39+
curl -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.package' | jq -s '.[] | .name'
40+
# check what channels are included in the wavefront package
41+
curl -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.channel&package=wavefront' | jq -s '.[] | .name'
42+
# check what bundles are included in the wavefront package
43+
curl -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] | .name'
44+

0 commit comments

Comments
 (0)