Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,18 @@ tidy: #HELP Update dependencies.
# Force tidy to use the version already in go.mod
$(Q)go mod tidy -go=$(GOLANG_VERSION)


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

.PHONY: generate
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
17 changes: 2 additions & 15 deletions catalogd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ help: ## Display this help.
clean: ## Remove binaries and test artifacts
rm -rf bin

.PHONY: generate
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
KUSTOMIZE_RBAC_DIR := config/base/rbac
KUSTOMIZE_WEBHOOKS_DIR := config/base/manager/webhook
generate: $(CONTROLLER_GEN) ## Generate code and manifests.
$(CONTROLLER_GEN) object:headerFile="../hack/boilerplate.go.txt" paths="./..."
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/..." output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
rm -f $(KUSTOMIZE_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/..." output:webhook:artifacts:config=$(KUSTOMIZE_WEBHOOKS_DIR)

##@ Build

BINARIES=catalogd
Expand Down Expand Up @@ -98,18 +88,15 @@ export GO_BUILD_TAGS := containers_image_openpgp

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

.PHONY: build-deps
build-deps: generate

.PHONY: build go-build-local $(BINARIES)
build: build-deps go-build-local ## Build binaries for current GOOS and GOARCH.
build: go-build-local ## Build binaries for current GOOS and GOARCH.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little bit unfortunate, as it requires that the root Makefile has already run it's generate target. But since this is just temporary, and we don't have any CI or dev flows where we would be running make tasks directly in the catalogd Makefile, I think its fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. We should move rest of the Makefile soon and that would remove the gap.

go-build-local: $(BINARIES)
$(BINARIES): BUILDBIN = bin
$(BINARIES):
$(BUILDCMD)

.PHONY: build-linux go-build-linux $(LINUX_BINARIES)
build-linux: build-deps go-build-linux ## Build binaries for GOOS=linux and local GOARCH.
build-linux: go-build-linux ## Build binaries for GOOS=linux and local GOARCH.
go-build-linux: $(LINUX_BINARIES)
$(LINUX_BINARIES): BUILDBIN = bin/linux
$(LINUX_BINARIES):
Expand Down
4 changes: 2 additions & 2 deletions catalogd/cmd/catalogd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ import (
crwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"

catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
corecontrollers "github.com/operator-framework/operator-controller/catalogd/internal/controllers/core"
"github.com/operator-framework/operator-controller/catalogd/internal/webhook"
corecontrollers "github.com/operator-framework/operator-controller/internal/catalogd/controllers/core"
"github.com/operator-framework/operator-controller/internal/catalogd/features"
"github.com/operator-framework/operator-controller/internal/catalogd/garbagecollection"
catalogdmetrics "github.com/operator-framework/operator-controller/internal/catalogd/metrics"
"github.com/operator-framework/operator-controller/internal/catalogd/serverutil"
"github.com/operator-framework/operator-controller/internal/catalogd/source"
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
"github.com/operator-framework/operator-controller/internal/catalogd/webhook"
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
"github.com/operator-framework/operator-controller/internal/shared/version"
)
Expand Down
Loading