From cb9af75c8fc39df9b2c04db7d71d04701e0a701b Mon Sep 17 00:00:00 2001 From: Jordan Keister Date: Wed, 19 Feb 2025 14:37:51 -0600 Subject: [PATCH 1/3] add metas query info to tutorials, demos Signed-off-by: Jordan Keister --- hack/demo/catalogd-metas-demo-script.sh | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 hack/demo/catalogd-metas-demo-script.sh diff --git a/hack/demo/catalogd-metas-demo-script.sh b/hack/demo/catalogd-metas-demo-script.sh new file mode 100755 index 000000000..5b058b22e --- /dev/null +++ b/hack/demo/catalogd-metas-demo-script.sh @@ -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 +# ... checking clustercatalog is serving +kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s +# ... checking clustercatalog is finished unpacking +kubectl wait --for=condition=Progressing=False 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)& + +sleep 3 + +# check what 'packages' are available in this catalog +curl -vvv -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 -vvv -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 -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] | .name' + From a998d775269b76826622586c45b4fdfb22725e29 Mon Sep 17 00:00:00 2001 From: Jordan Keister Date: Fri, 28 Feb 2025 13:53:02 -0600 Subject: [PATCH 2/3] add metas endpoint demo script Signed-off-by: Jordan Keister --- Makefile | 7 ++++++- hack/demo/catalogd-metas-demo-script.sh | 26 ++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 9abc35b3d..76c266ad6 100644 --- a/Makefile +++ b/Makefile @@ -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 sideeffects 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 diff --git a/hack/demo/catalogd-metas-demo-script.sh b/hack/demo/catalogd-metas-demo-script.sh index 5b058b22e..5a26c70f1 100755 --- a/hack/demo/catalogd-metas-demo-script.sh +++ b/hack/demo/catalogd-metas-demo-script.sh @@ -4,13 +4,13 @@ # 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 +## until we cut a release containing the new API, we need to deploy local artifacts +make kind-clean +make run +# +## 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 @@ -26,19 +26,19 @@ kubectl patch -n olmv1-system deploy/catalogd-controller-manager --type='json' - kubectl rollout status -n olmv1-system deploy/catalogd-controller-manager # ... checking clustercatalog is serving kubectl wait --for=condition=Serving clustercatalog/operatorhubio --timeout=60s -# ... checking clustercatalog is finished unpacking -kubectl wait --for=condition=Progressing=False clustercatalog/operatorhubio --timeout=60s +# ... checking clustercatalog is finished unpacking (progressing gone back to true) +kubectl wait --for=condition=Progressing=True clustercatalog/operatorhubio --timeout=60s +sleep 30 # 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)& -sleep 3 # check what 'packages' are available in this catalog -curl -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.package' | jq -s '.[] | .name' +curl -f -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 -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.channel&package=wavefront' | jq -s '.[] | .name' +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 -vvv -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] | .name' +curl -f -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.bundle&package=wavefront' | jq -s '.[] |.name' From 0303310a50df8b9d77c37ef8e738266d3c1d4e5e Mon Sep 17 00:00:00 2001 From: Jordan Keister Date: Wed, 5 Mar 2025 09:29:06 -0600 Subject: [PATCH 3/3] review resolutions Signed-off-by: Jordan Keister --- Makefile | 2 +- hack/demo/catalogd-demo-script.sh | 2 +- hack/demo/catalogd-metas-demo-script.sh | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 76c266ad6..2010d453f 100644 --- a/Makefile +++ b/Makefile @@ -302,7 +302,7 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster. #SECTION Build # attempt to generate the VERSION attribute for certificates -# fail if it is unset afterwards, since the sideeffects are indirect +# fail if it is unset afterwards, since the side effects are indirect ifeq ($(strip $(VERSION)),) VERSION := $(shell git describe --tags --always --dirty) endif diff --git a/hack/demo/catalogd-demo-script.sh b/hack/demo/catalogd-demo-script.sh index bbde25071..e7f226f24 100755 --- a/hack/demo/catalogd-demo-script.sh +++ b/hack/demo/catalogd-demo-script.sh @@ -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)& diff --git a/hack/demo/catalogd-metas-demo-script.sh b/hack/demo/catalogd-metas-demo-script.sh index 5a26c70f1..63fb84b83 100755 --- a/hack/demo/catalogd-metas-demo-script.sh +++ b/hack/demo/catalogd-metas-demo-script.sh @@ -4,13 +4,13 @@ # trap 'trap - SIGTERM && kill -- -"$$"' SIGINT SIGTERM EXIT -## until we cut a release containing the new API, we need to deploy local artifacts -make kind-clean -make run -# -## 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 -# +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 @@ -24,19 +24,19 @@ kubectl patch -n olmv1-system deploy/catalogd-controller-manager --type='json' - # ... 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 -sleep 30 # 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 -k 'https://localhost:8081/catalogs/operatorhubio/api/v1/metas?schema=olm.package' | jq -s '.[] | .name' +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