Skip to content

Commit 2a5e9b8

Browse files
authored
Consolidate configuration (#1790)
This moves all the configuration into the root config directory. The config/README.md file shows the result. Updated Makefile, goreleaser, documentation and some of the unit test code. Kept CRDs in their original locations, but made copies to the new locations to keep the verify-crd-compatibility target working properly. Once this is merged, a followup will remove the CRDs from the original locations and update the verify-crd-compatibility target. It also tries to make catalogd less of a second-class piece of code. I compared the resulting operator-controller.yaml with main, and with the exception of `image` locations, they are identical. Signed-off-by: Todd Short <tshort@redhat.com>
1 parent dd4d61f commit 2a5e9b8

File tree

81 files changed

+1196
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1196
-297
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ release:
124124
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}'
125125
extra_files:
126126
- glob: 'operator-controller.yaml'
127-
- glob: './catalogd/config/base/default/clustercatalogs/default-catalogs.yaml'
127+
- glob: './config/catalogs/clustercatalogs/default-catalogs.yaml'
128128
- glob: 'install.sh'
129129
header: |
130130
## Installation

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ $(warning Could not find docker or podman in path! This may result in targets re
6565
endif
6666

6767
KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
68-
CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/cert-manager
6968

7069
# Disable -j flag for make
7170
.NOTPARALLEL:
@@ -114,17 +113,19 @@ tidy: #HELP Update dependencies.
114113
$(Q)go mod tidy -go=$(GOLANG_VERSION)
115114

116115
.PHONY: manifests
117-
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
118-
KUSTOMIZE_RBAC_DIR := config/base/rbac
119-
KUSTOMIZE_WEBHOOKS_DIR := config/base/manager/webhook
116+
KUSTOMIZE_CATD_CRDS_DIR := config/base/catalogd/crd/bases
117+
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
118+
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
119+
KUSTOMIZE_OPCON_CRDS_DIR := config/base/operator-controller/crd/bases
120+
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
120121
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
121122
# Generate the operator-controller manifests
122-
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
123-
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
123+
rm -rf $(KUSTOMIZE_OPCON_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=$(KUSTOMIZE_OPCON_CRDS_DIR)
124+
rm -f $(KUSTOMIZE_OPCON_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
124125
# Generate the catalogd manifests
125-
rm -rf catalogd/$(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./catalogd/api/..." output:crd:artifacts:config=catalogd/$(KUSTOMIZE_CRDS_DIR)
126-
rm -f catalogd/$(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=catalogd/$(KUSTOMIZE_RBAC_DIR)
127-
rm -f catalogd/$(KUSTOMIZE_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=catalogd/$(KUSTOMIZE_WEBHOOKS_DIR)
126+
rm -rf $(KUSTOMIZE_CATD_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./catalogd/api/..." output:crd:artifacts:config=$(KUSTOMIZE_CATD_CRDS_DIR)
127+
rm -f $(KUSTOMIZE_CATD_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
128+
rm -f $(KUSTOMIZE_CATD_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
128129

129130
.PHONY: generate
130131
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -221,7 +222,6 @@ image-registry: ## Build the testdata catalog used for e2e tests and push it to
221222
test-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
222223
test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
223224
test-e2e: GO_BUILD_FLAGS := -cover
224-
test-e2e: CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/e2e
225225
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
226226

227227
.PHONY: extension-developer-e2e
@@ -259,9 +259,9 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
259259

260260
.PHONY: kind-deploy
261261
kind-deploy: export MANIFEST := ./operator-controller.yaml
262-
kind-deploy: export DEFAULT_CATALOG := ./catalogd/config/base/default/clustercatalogs/default-catalogs.yaml
262+
kind-deploy: export DEFAULT_CATALOG := ./config/catalogs/clustercatalogs/default-catalogs.yaml
263263
kind-deploy: manifests $(KUSTOMIZE)
264-
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build $(CATALOGD_KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST)
264+
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" > $(MANIFEST)
265265
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
266266

267267
.PHONY: kind-cluster
@@ -347,7 +347,7 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
347347
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
348348
quickstart: export DEFAULT_CATALOG := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/default-catalogs.yaml"
349349
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation release manifests and scripts.
350-
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
350+
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
351351
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
352352

353353
##@ Docs
@@ -367,7 +367,7 @@ crd-ref-docs: $(CRD_REF_DOCS) #EXHELP Generate the API Reference Documents.
367367
$(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/catalogd/api \
368368
--config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
369369
--renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME);
370-
370+
371371
VENVDIR := $(abspath docs/.venv)
372372

373373
.PHONY: build-docs

Tiltfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load('.tilt-support', 'deploy_repo')
22

33
operator_controller = {
44
'image': 'quay.io/operator-framework/operator-controller',
5-
'yaml': 'config/overlays/tilt-local-dev',
5+
'yaml': 'config/overlays/tilt-local-dev/operator-controller',
66
'binaries': {
77
'./cmd/operator-controller': 'operator-controller-controller-manager',
88
},
@@ -13,7 +13,7 @@ deploy_repo('operator-controller', operator_controller, '-tags containers_image_
1313

1414
catalogd = {
1515
'image': 'quay.io/operator-framework/catalogd',
16-
'yaml': 'catalogd/config/overlays/cert-manager',
16+
'yaml': 'config/overlays/tilt-local-dev/catalogd',
1717
'binaries': {
1818
'./catalogd/cmd/catalogd': 'catalogd-controller-manager',
1919
},

catalogd/api/v1/clustercatalog_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"sigs.k8s.io/yaml"
2121
)
2222

23-
const crdFilePath = "../../config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
23+
const crdFilePath = "../../../config/base/catalogd/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
2424

2525
func TestImageSourceCELValidationRules(t *testing.T) {
2626
validators := fieldValidatorsFromFile(t, crdFilePath)

catalogd/config/base/default/kustomization.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

catalogd/config/components/ca/kustomization.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

catalogd/config/components/registries-conf/kustomization.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

catalogd/config/components/registries-conf/manager_e2e_registries_conf_patch.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

catalogd/config/components/registries-conf/registries_conf_configmap.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

catalogd/config/overlays/cert-manager/kustomization.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)