diff --git a/Makefile b/Makefile index 587502ff9..de5848aee 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ export CERT_MGR_VERSION := v1.9.0 export CATALOGD_VERSION := $(shell go list -mod=mod -m -f "{{.Version}}" github.com/operator-framework/catalogd) export WAIT_TIMEOUT := 60s +# Install default ClusterCatalogs +export INSTALL_DEFAULT_CATALOGS := true + # By default setup-envtest will write to $XDG_DATA_HOME, or $HOME/.local/share if that is not defined. # If $HOME is not set, we need to specify a binary directory to prevent an error in setup-envtest. # Useful for some CI/CD environments that set neither $XDG_DATA_HOME nor $HOME. @@ -135,6 +138,7 @@ export E2E_TEST_CATALOG_V1 := e2e/test-catalog:v1 export E2E_TEST_CATALOG_V2 := e2e/test-catalog:v2 export CATALOG_IMG := $(LOCAL_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V1) .PHONY: test-ext-dev-e2e +test-ext-dev-e2e: export INSTALL_DEFAULT_CATALOGS="false" test-ext-dev-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension create, upgrade and delete tests. test/extension-developer-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) $(KIND) $(KIND_CLUSTER_NAME) $(E2E_REGISTRY_NAMESPACE) go test -count=1 -v ./test/extension-developer-e2e/... @@ -200,7 +204,7 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed image onto the cluste kind-deploy: export MANIFEST="./operator-controller.yaml" kind-deploy: manifests $(KUSTOMIZE) #EXHELP Install controller and dependencies onto the kind cluster. $(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) > operator-controller.yaml - envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s + envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s .PHONY: kind-cluster kind-cluster: $(KIND) #EXHELP Standup a kind cluster. @@ -284,7 +288,7 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the installation release manifests and scripts. $(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml - envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh + envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh ##@ Docs diff --git a/scripts/install.tpl.sh b/scripts/install.tpl.sh index 1b44ac630..3b8ac5057 100644 --- a/scripts/install.tpl.sh +++ b/scripts/install.tpl.sh @@ -11,6 +11,7 @@ fi catalogd_version=$CATALOGD_VERSION cert_mgr_version=$CERT_MGR_VERSION +install_default_catalogs=$INSTALL_DEFAULT_CATALOGS if [[ -z "$catalogd_version" || -z "$cert_mgr_version" ]]; then err="Error: Missing component version(s) for: " @@ -38,5 +39,10 @@ kubectl_wait "cert-manager" "deployment/cert-manager-webhook" "60s" kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/catalogd.yaml" kubectl_wait "olmv1-system" "deployment/catalogd-controller-manager" "60s" +if [[ "${install_default_catalogs,,}" == "true" ]] + kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/default-catalogs.yaml" + kubectl wait --for=condition=Unpacked "clustercatalog/operatorhubio" --timeout="60s" +fi + kubectl apply -f "${operator_controller_manifest}" kubectl_wait "olmv1-system" "deployment/operator-controller-controller-manager" "60s"