Skip to content

Commit 2d8e3c9

Browse files
Unify YAML and fix install script
Now, we have olmv1.yaml with the kustomize files for both projects Therefore, we have now only the install.sh and olmv1.yaml artifacts
1 parent f7ea0a3 commit 2d8e3c9

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ coverage
2121
# Release output
2222
dist/**
2323
operator-controller.yaml
24+
olmv1.yaml
2425
install.sh
2526

2627
# Kubernetes Generated files - skip generated files, except for vendored files

Makefile

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ IMG := $(IMAGE_REPO):$(IMAGE_TAG)
2323

2424
# Define dependency versions (use go.mod if we also use Go code from dependency)
2525
export CERT_MGR_VERSION := v1.15.3
26-
export CATALOGD_VERSION := $(shell go list -mod=mod -m -f "{{.Version}}" github.com/operator-framework/catalogd)
2726
export WAIT_TIMEOUT := 60s
2827

2928
# Install default ClusterCatalogs
@@ -228,15 +227,20 @@ test-upgrade-e2e: kind-cluster run-latest-release image-registry pre-upgrade-set
228227
e2e-coverage:
229228
COVERAGE_OUTPUT=./coverage/e2e.out ./hack/test/e2e-coverage.sh
230229

231-
.PHONY: kind-load
232-
kind-load: $(KIND) #EXHELP Loads the currently constructed image onto the cluster.
230+
kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND cluster.
233231
$(CONTAINER_RUNTIME) save $(IMG) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
232+
IMAGE_REPO=quay.io/operator-framework/catalogd KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) $(MAKE) -C catalogd kind-load
234233

235234
.PHONY: kind-deploy
236-
kind-deploy: export MANIFEST="./operator-controller.yaml"
237-
kind-deploy: manifests $(KUSTOMIZE) #EXHELP Install controller and dependencies onto the kind cluster.
238-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) > operator-controller.yaml
239-
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
235+
kind-deploy: export MANIFEST := ./olmv1.yaml
236+
kind-deploy: manifests generate-catalogd $(KUSTOMIZE)
237+
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST)
238+
envsubst '$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
239+
240+
241+
.PHONY: generate-catalogd
242+
generate-catalogd: ## Generate the catalogd manifests
243+
$(MAKE) -C catalogd generate
240244

241245
.PHONY: kind-cluster
242246
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
@@ -293,9 +297,13 @@ go-build-linux: $(BINARIES)
293297
run: docker-build kind-cluster kind-load kind-deploy #HELP Build the operator-controller then deploy it into a new kind cluster.
294298

295299
.PHONY: docker-build
296-
docker-build: build-linux #EXHELP Build docker image for operator-controller with GOOS=linux and local GOARCH.
300+
docker-build: build-linux build-catalogd #EXHELP Build docker image for operator-controller with GOOS=linux and local GOARCH.
297301
$(CONTAINER_RUNTIME) build -t $(IMG) -f Dockerfile ./bin/linux
298302

303+
.PHONY: build-catalogd
304+
build-catalogd: ## Build the catalogd image
305+
IMAGE_REPO=quay.io/operator-framework/catalogd $(MAKE) -C catalogd build-container
306+
299307
#SECTION Release
300308
ifeq ($(origin ENABLE_RELEASE_PIPELINE), undefined)
301309
ENABLE_RELEASE_PIPELINE := false
@@ -312,10 +320,10 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
312320
$(GORELEASER) $(GORELEASER_ARGS)
313321

314322
.PHONY: quickstart
315-
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
316-
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the installation release manifests and scripts.
317-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
318-
envsubst '$$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
323+
quickstart: export MANIFEST := ./olmv1.yaml
324+
quickstart: $(KUSTOMIZE) manifests build-catalogd #EXHELP Generate the unified installation release manifests and scripts.
325+
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST)
326+
envsubst '$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
319327

320328
##@ Docs
321329

catalogd/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
SHELL := /usr/bin/env bash -o pipefail
44
.SHELLFLAGS := -ec
55

6-
GOLANG_VERSION := $(shell sed -En 's/^go (.*)$$/\1/p' "go.mod")
7-
86
ifeq ($(origin IMAGE_REPO), undefined)
97
IMAGE_REPO := quay.io/operator-framework/catalogd
108
endif

scripts/install.tpl.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,19 @@
22
set -euo pipefail
33
IFS=$'\n\t'
44

5-
operator_controller_manifest=$MANIFEST
5+
olmv1_manifest=$MANIFEST
66

7-
if [[ -z "$operator_controller_manifest" ]]; then
7+
if [[ -z "$olmv1_manifest" ]]; then
88
echo "Error: Missing required MANIFEST variable"
99
exit 1
1010
fi
1111

12-
catalogd_version=$CATALOGD_VERSION
12+
default_catalogs_manifest="./catalogd/config/base/default/clustercatalogs/default-catalogs.yaml"
1313
cert_mgr_version=$CERT_MGR_VERSION
1414
install_default_catalogs=$INSTALL_DEFAULT_CATALOGS
1515

16-
if [[ -z "$catalogd_version" || -z "$cert_mgr_version" ]]; then
17-
err="Error: Missing component version(s) for: "
18-
if [[ -z "$catalogd_version" ]]; then
19-
err+="catalogd "
20-
fi
21-
if [[ -z "$cert_mgr_version" ]]; then
22-
err+="cert-manager "
23-
fi
24-
echo "$err"
16+
if [[ -z "$cert_mgr_version" ]]; then
17+
echo "Error: Missing CERT_MGR_VERSION variable"
2518
exit 1
2619
fi
2720

@@ -76,15 +69,18 @@ kubectl_wait "cert-manager" "deployment/cert-manager" "60s"
7669
kubectl_wait_for_query "mutatingwebhookconfigurations/cert-manager-webhook" '{.webhooks[0].clientConfig.caBundle}' 60 5
7770
kubectl_wait_for_query "validatingwebhookconfigurations/cert-manager-webhook" '{.webhooks[0].clientConfig.caBundle}' 60 5
7871

79-
kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/catalogd.yaml"
72+
kubectl apply -f "${olmv1_manifest}"
8073
# Wait for the rollout, and then wait for the deployment to be Available
8174
kubectl_wait_rollout "olmv1-system" "deployment/catalogd-controller-manager" "60s"
8275
kubectl_wait "olmv1-system" "deployment/catalogd-controller-manager" "60s"
76+
kubectl_wait "olmv1-system" "deployment/operator-controller-controller-manager" "60s"
8377

8478
if [[ "${install_default_catalogs}" != "false" ]]; then
85-
kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/default-catalogs.yaml"
79+
if [[ ! -f "$default_catalogs_manifest" ]]; then
80+
echo "Error: Missing required default catalogs manifest file at $default_catalogs_manifest"
81+
exit 1
82+
fi
83+
84+
kubectl apply -f "${default_catalogs_manifest}"
8685
kubectl wait --for=condition=Serving "clustercatalog/operatorhubio" --timeout="60s"
8786
fi
88-
89-
kubectl apply -f "${operator_controller_manifest}"
90-
kubectl_wait "olmv1-system" "deployment/operator-controller-controller-manager" "60s"

0 commit comments

Comments
 (0)