Skip to content

Commit ed87a01

Browse files
authored
Install default-catalogs from Catalogd release (#1079)
Note: setup.sh for extension-developer-e2e now removes the OperatorHub clustercatalog so it doesn't interfere with testing. Signed-off-by: Tayler Geiger <[email protected]>
1 parent 06b2455 commit ed87a01

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export CERT_MGR_VERSION := v1.9.0
2525
export CATALOGD_VERSION := $(shell go list -mod=mod -m -f "{{.Version}}" github.com/operator-framework/catalogd)
2626
export WAIT_TIMEOUT := 60s
2727

28+
# Install default ClusterCatalogs
29+
export INSTALL_DEFAULT_CATALOGS := true
30+
2831
# By default setup-envtest will write to $XDG_DATA_HOME, or $HOME/.local/share if that is not defined.
2932
# If $HOME is not set, we need to specify a binary directory to prevent an error in setup-envtest.
3033
# Useful for some CI/CD environments that set neither $XDG_DATA_HOME nor $HOME.
@@ -168,6 +171,7 @@ test-e2e: run image-registry build-push-e2e-catalog registry-load-bundles e2e e2
168171
.PHONY: extension-developer-e2e
169172
extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
170173
extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e #EXHELP Run extension-developer e2e on local kind cluster
174+
extension-developer-e2e: export INSTALL_DEFAULT_CATALOGS := false #EXHELP Run extension-developer e2e on local kind cluster
171175
extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean
172176

173177
.PHONY: run-latest-release
@@ -200,7 +204,7 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed image onto the cluste
200204
kind-deploy: export MANIFEST="./operator-controller.yaml"
201205
kind-deploy: manifests $(KUSTOMIZE) #EXHELP Install controller and dependencies onto the kind cluster.
202206
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) > operator-controller.yaml
203-
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s
207+
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
204208

205209
.PHONY: kind-cluster
206210
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
@@ -284,7 +288,7 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
284288
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
285289
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the installation release manifests and scripts.
286290
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
287-
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh
291+
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
288292

289293
##@ Docs
290294

scripts/install.tpl.sh

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fi
1111

1212
catalogd_version=$CATALOGD_VERSION
1313
cert_mgr_version=$CERT_MGR_VERSION
14+
install_default_catalogs=$INSTALL_DEFAULT_CATALOGS
1415

1516
if [[ -z "$catalogd_version" || -z "$cert_mgr_version" ]]; then
1617
err="Error: Missing component version(s) for: "
@@ -38,5 +39,10 @@ kubectl_wait "cert-manager" "deployment/cert-manager-webhook" "60s"
3839
kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/catalogd.yaml"
3940
kubectl_wait "olmv1-system" "deployment/catalogd-controller-manager" "60s"
4041

42+
if [[ "${install_default_catalogs,,}" != "false" ]]; then
43+
kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/default-catalogs.yaml"
44+
kubectl wait --for=condition=Unpacked "clustercatalog/operatorhubio" --timeout="60s"
45+
fi
46+
4147
kubectl apply -f "${operator_controller_manifest}"
4248
kubectl_wait "olmv1-system" "deployment/operator-controller-controller-manager" "60s"

0 commit comments

Comments
 (0)