|
| 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