Skip to content

Commit 43dfc65

Browse files
🌱 Move catalogd controllers and webhooks to internal/catalogd (#1749)
* Moving catalogd controllers and webhook Moving catalogd/internal/controllers and catalogd/internal/webhooks to internal/catalogd along with the Makefile changes Signed-off-by: Lalatendu Mohanty <[email protected]> * Removed 'build-deps' target from catalogd Makefile As build-deps needs the generate target which has been moved to the root Makefile i.e. operator-controller/Makefile Signed-off-by: Lalatendu Mohanty <[email protected]> --------- Signed-off-by: Lalatendu Mohanty <[email protected]>
1 parent becde51 commit 43dfc65

9 files changed

+10
-21
lines changed

Makefile

+6-4
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,18 @@ tidy: #HELP Update dependencies.
115115
# Force tidy to use the version already in go.mod
116116
$(Q)go mod tidy -go=$(GOLANG_VERSION)
117117

118-
119118
.PHONY: manifests
120119
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
121120
KUSTOMIZE_RBAC_DIR := config/base/rbac
121+
KUSTOMIZE_WEBHOOKS_DIR := config/base/manager/webhook
122122
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
123-
# To generate the manifests used and do not use catalogd directory
123+
# Generate the operator-controller manifests
124124
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
125125
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
126-
# To generate the manifests for catalogd
127-
$(MAKE) -C catalogd generate
126+
# Generate the catalogd manifests
127+
rm -rf catalogd/$(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./catalogd/api/..." output:crd:artifacts:config=catalogd/$(KUSTOMIZE_CRDS_DIR)
128+
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)
129+
rm -f catalogd/$(KUSTOMIZE_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=catalogd/$(KUSTOMIZE_WEBHOOKS_DIR)
128130

129131
.PHONY: generate
130132
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

catalogd/Makefile

+2-15
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ help: ## Display this help.
5858
clean: ## Remove binaries and test artifacts
5959
rm -rf bin
6060

61-
.PHONY: generate
62-
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
63-
KUSTOMIZE_RBAC_DIR := config/base/rbac
64-
KUSTOMIZE_WEBHOOKS_DIR := config/base/manager/webhook
65-
generate: $(CONTROLLER_GEN) ## Generate code and manifests.
66-
$(CONTROLLER_GEN) object:headerFile="../hack/boilerplate.go.txt" paths="./..."
67-
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
68-
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/..." output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
69-
rm -f $(KUSTOMIZE_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/..." output:webhook:artifacts:config=$(KUSTOMIZE_WEBHOOKS_DIR)
70-
7161
##@ Build
7262

7363
BINARIES=catalogd
@@ -98,18 +88,15 @@ export GO_BUILD_TAGS := containers_image_openpgp
9888

9989
BUILDCMD = go build -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN)/$(notdir $@) ./cmd/$(notdir $@)
10090

101-
.PHONY: build-deps
102-
build-deps: generate
103-
10491
.PHONY: build go-build-local $(BINARIES)
105-
build: build-deps go-build-local ## Build binaries for current GOOS and GOARCH.
92+
build: go-build-local ## Build binaries for current GOOS and GOARCH.
10693
go-build-local: $(BINARIES)
10794
$(BINARIES): BUILDBIN = bin
10895
$(BINARIES):
10996
$(BUILDCMD)
11097

11198
.PHONY: build-linux go-build-linux $(LINUX_BINARIES)
112-
build-linux: build-deps go-build-linux ## Build binaries for GOOS=linux and local GOARCH.
99+
build-linux: go-build-linux ## Build binaries for GOOS=linux and local GOARCH.
113100
go-build-linux: $(LINUX_BINARIES)
114101
$(LINUX_BINARIES): BUILDBIN = bin/linux
115102
$(LINUX_BINARIES):

catalogd/cmd/catalogd/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ import (
5656
crwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
5757

5858
catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
59-
corecontrollers "github.com/operator-framework/operator-controller/catalogd/internal/controllers/core"
60-
"github.com/operator-framework/operator-controller/catalogd/internal/webhook"
59+
corecontrollers "github.com/operator-framework/operator-controller/internal/catalogd/controllers/core"
6160
"github.com/operator-framework/operator-controller/internal/catalogd/features"
6261
"github.com/operator-framework/operator-controller/internal/catalogd/garbagecollection"
6362
catalogdmetrics "github.com/operator-framework/operator-controller/internal/catalogd/metrics"
6463
"github.com/operator-framework/operator-controller/internal/catalogd/serverutil"
6564
"github.com/operator-framework/operator-controller/internal/catalogd/source"
6665
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
66+
"github.com/operator-framework/operator-controller/internal/catalogd/webhook"
6767
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
6868
"github.com/operator-framework/operator-controller/internal/shared/version"
6969
)

0 commit comments

Comments
 (0)