Skip to content

Commit dbd2bd9

Browse files
authored
🌱 Add catalogd metas service demo (#1840)
* add metas query info to tutorials, demos Signed-off-by: Jordan Keister <[email protected]> * add metas endpoint demo script Signed-off-by: Jordan Keister <[email protected]> * review resolutions Signed-off-by: Jordan Keister <[email protected]> --------- Signed-off-by: Jordan Keister <[email protected]>
1 parent e4e76d2 commit dbd2bd9

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,15 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster.
301301

302302
#SECTION Build
303303

304-
ifeq ($(origin VERSION), undefined)
304+
# attempt to generate the VERSION attribute for certificates
305+
# fail if it is unset afterwards, since the side effects are indirect
306+
ifeq ($(strip $(VERSION)),)
305307
VERSION := $(shell git describe --tags --always --dirty)
306308
endif
307309
export VERSION
310+
ifeq ($(strip $(VERSION)),)
311+
$(error undefined VERSION; resulting certs will be invalid)
312+
endif
308313

309314
ifeq ($(origin CGO_ENABLED), undefined)
310315
CGO_ENABLED := 0

hack/demo/catalogd-demo-script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controlle
2323
echo "... checking clustercatalog is serving"
2424
kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s
2525
echo "... checking clustercatalog is finished unpacking"
26-
kubectl wait --for=condition=Progressing=False clustercatalog/operatorhubio --timeout=60s
26+
kubectl wait --for=condition=Progressing=True clustercatalog/operatorhubio --timeout=60s
2727

2828
# port forward the catalogd-service service to interact with the HTTP server serving catalog contents
2929
(kubectl -n olmv1-system port-forward svc/catalogd-service 8081:443)&
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+
kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controller-manager --timeout=1m
28+
# ... checking clustercatalog is serving
29+
kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s
30+
# ... checking clustercatalog is finished unpacking (progressing gone back to true)
31+
kubectl wait --for=condition=Progressing=True clustercatalog/operatorhubio --timeout=60s
32+
33+
34+
# port forward the catalogd-service service to interact with the HTTP server serving catalog contents
35+
(kubectl -n olmv1-system port-forward svc/catalogd-service 8081:443)&
36+
37+
38+
# check what 'packages' are available in this catalog
39+
curl -f --retry-all-errors --retry 10 -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 -f -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 -f -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] |.name'
44+

0 commit comments

Comments
 (0)