Skip to content

🌱 Add catalogd metas service demo #1840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,15 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster.

#SECTION Build

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

ifeq ($(origin CGO_ENABLED), undefined)
CGO_ENABLED := 0
Expand Down
2 changes: 1 addition & 1 deletion hack/demo/catalogd-demo-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controlle
echo "... checking clustercatalog is serving"
kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s
echo "... checking clustercatalog is finished unpacking"
kubectl wait --for=condition=Progressing=False clustercatalog/operatorhubio --timeout=60s
kubectl wait --for=condition=Progressing=True clustercatalog/operatorhubio --timeout=60s

# port forward the catalogd-service service to interact with the HTTP server serving catalog contents
(kubectl -n olmv1-system port-forward svc/catalogd-service 8081:443)&
Expand Down
44 changes: 44 additions & 0 deletions hack/demo/catalogd-metas-demo-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
#
# Welcome to the catalogd metas API endpoint demo
#
trap 'trap - SIGTERM && kill -- -"$$"' SIGINT SIGTERM EXIT

kind delete cluster
kind create cluster
kubectl cluster-info --context kind-kind
sleep 10

# use the install script from the latest github release
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash

# inspect crds (clustercatalog)
kubectl get crds -A
kubectl get clustercatalog -A

# ... checking catalogd controller is available
kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controller-manager --timeout=1m

# patch the deployment to include the feature gate
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"}]'

# ... waiting for new deployment for catalogd controller to become available
kubectl rollout status -n olmv1-system deploy/catalogd-controller-manager
kubectl wait --for=condition=Available -n olmv1-system deploy/catalogd-controller-manager --timeout=1m
# ... checking clustercatalog is serving
kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s
# ... checking clustercatalog is finished unpacking (progressing gone back to true)
kubectl wait --for=condition=Progressing=True clustercatalog/operatorhubio --timeout=60s


# port forward the catalogd-service service to interact with the HTTP server serving catalog contents
(kubectl -n olmv1-system port-forward svc/catalogd-service 8081:443)&


# check what 'packages' are available in this catalog
curl -f --retry-all-errors --retry 10 -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.package' | jq -s '.[] | .name'
# check what channels are included in the wavefront package
curl -f -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.channel&package=wavefront' | jq -s '.[] |.name'
# check what bundles are included in the wavefront package
curl -f -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] |.name'