Skip to content

Commit b004bc2

Browse files
authored
Add manifests directory (#2025)
Check-in manifests to the manifests directory. Currently, there is: * "standard" manifests, which is used as the basis for e2e and quickstart * "cluster-catalogs" manifests, which is just moved from the config dir Signed-off-by: Todd Short <tshort@redhat.com>
1 parent 1a27741 commit b004bc2

File tree

3 files changed

+1866
-6
lines changed

3 files changed

+1866
-6
lines changed

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export RELEASE_MANIFEST := operator-controller.yaml
8383
export RELEASE_INSTALL := install.sh
8484
export RELEASE_CATALOGS := default-catalogs.yaml
8585

86-
CATALOGS_MANIFEST := ./config/catalogs/clustercatalogs/default-catalogs.yaml
86+
# List of manifests that are checked in
87+
MANIFEST_HOME := ./manifests
88+
STANDARD_MANIFEST := ./manifests/standard.yaml
89+
CATALOGS_MANIFEST := ./manifests/default-catalogs.yaml
8790

8891
# Disable -j flag for make
8992
.NOTPARALLEL:
@@ -143,7 +146,7 @@ KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
143146
CRD_WORKING_DIR := crd_work_dir
144147
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
145148
# So we have to generate them together and then move them into place
146-
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
149+
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
147150
mkdir $(CRD_WORKING_DIR)
148151
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) crd paths="./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR)
149152
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR)
@@ -154,6 +157,9 @@ manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole,
154157
# Generate the remaining catalogd manifests
155158
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
156159
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
160+
# Generate manifests stored in source-control
161+
mkdir -p $(MANIFEST_HOME)
162+
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) > $(STANDARD_MANIFEST)
157163

158164
.PHONY: generate
159165
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -296,8 +302,8 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
296302
.PHONY: kind-deploy
297303
kind-deploy: export MANIFEST := $(RELEASE_MANIFEST)
298304
kind-deploy: export DEFAULT_CATALOG := $(RELEASE_CATALOGS)
299-
kind-deploy: manifests $(KUSTOMIZE)
300-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" > $(MANIFEST)
305+
kind-deploy: manifests
306+
sed "s/cert-git-version/cert-$(VERSION)/g" $(STANDARD_MANIFEST) > $(MANIFEST)
301307
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
302308
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
303309

@@ -390,8 +396,9 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
390396
.PHONY: quickstart
391397
quickstart: export MANIFEST := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/$(notdir $(RELEASE_MANIFEST))"
392398
quickstart: export DEFAULT_CATALOG := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/$(notdir $(RELEASE_CATALOGS))"
393-
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation release manifests and scripts.
394-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > $(RELEASE_MANIFEST)
399+
quickstart: manifests #EXHELP Generate the unified installation release manifests and scripts.
400+
# Update the stored standard manifests for distribution
401+
sed "s/:devel/:$(VERSION)/g" $(STANDARD_MANIFEST) | sed "s/cert-git-version/cert-$(VERSION)/g" > $(RELEASE_MANIFEST)
395402
cp $(CATALOGS_MANIFEST) $(RELEASE_CATALOGS)
396403
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > $(RELEASE_INSTALL)
397404

0 commit comments

Comments
 (0)