@@ -139,9 +139,9 @@ help: ## Display this help.
139139manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
140140 mkdir -p config/operator/rbac && \
141141 $(CONTROLLER_GEN ) crd$(CRDDESC_OVERRIDE ) output:crd:artifacts:config=config/crd/bases webhook paths=" ./..." && \
142- $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=" {./apis /client/...,./apis /core/...,./apis /dataplane/...,./controllers/ client/...,./controllers/ core/...,./controllers/ dataplane/...,./pkg /...}" output:dir=config/rbac && \
143- $(CONTROLLER_GEN ) rbac:roleName=operator-role paths=" ./controllers/ operator/..." paths=" ./apis /operator/..." output:dir=config/operator/rbac && \
144- rm -f apis /bases/* && cp -a config/crd/bases apis /
142+ $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=" {./api /client/...,./api /core/...,./api /dataplane/...,./internal/controller/ client/...,./internal/controller/ core/...,./internal/controller/ dataplane/...,./internal /...}" output:dir=config/rbac && \
143+ $(CONTROLLER_GEN ) rbac:roleName=operator-role paths=" ./internal/controller/ operator/..." paths=" ./api /operator/..." output:dir=config/operator/rbac && \
144+ rm -f api /bases/* && cp -a config/crd/bases api /
145145
146146.PHONY : generate
147147generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -171,22 +171,22 @@ fmt: ## Run go fmt against code.
171171.PHONY : vet
172172vet : gowork # # Run go vet against code.
173173 go vet ./...
174- go vet ./apis /...
174+ go vet ./api /...
175175
176176BRANCH ?= main
177177.PHONY : force-bump
178178force-bump : # # Force bump after tagging
179179 for dep in $$ (cat go.mod | grep openstack-k8s-operators | grep -vE -- ' indirect|openstack-operator|^replace' | awk ' {print $$1}' ); do \
180180 go get $$ dep@$(BRANCH ) ; \
181181 done
182- for dep in $$ (cat apis /go.mod | grep openstack-k8s-operators | grep -vE -- ' indirect|openstack-operator|^replace' | awk ' {print $$1}' ); do \
183- cd ./apis && go get $$ dep@$(BRANCH ) && cd .. ; \
182+ for dep in $$ (cat api /go.mod | grep openstack-k8s-operators | grep -vE -- ' indirect|openstack-operator|^replace' | awk ' {print $$1}' ); do \
183+ cd ./api && go get $$ dep@$(BRANCH ) && cd .. ; \
184184 done
185185
186186.PHONY : tidy
187187tidy : # # Run go mod tidy on every mod file in the repo
188188 go mod tidy
189- cd ./apis && go mod tidy
189+ cd ./api && go mod tidy
190190
191191GOLANGCI_LINT_VERSION ?= v2.4.0
192192.PHONY : golangci-lint
@@ -207,7 +207,7 @@ ginkgo-run: ## Run ginkgo.
207207 source hack/export_related_images.sh && \
208208 KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) -v debug --bin-dir $( LOCALBIN) use $( ENVTEST_K8S_VERSION) -p path) " \
209209 OPERATOR_TEMPLATES=" $( PWD) /templates" \
210- $(GINKGO ) --trace --cover --coverpkg=./pkg /...,./controllers/...,./apis /... --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS ) $(GINKGO_TESTS )
210+ $(GINKGO ) --trace --cover --coverpkg=./internal /...,./api /... --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS ) $(GINKGO_TESTS )
211211
212212.PHONY : test-all
213213test-all : test golint golangci golangci-lint # # Run all tests.
@@ -220,7 +220,7 @@ cover: test ## Run tests and display functional test coverage
220220
221221.PHONY : build
222222build : generate fmt vet # # Build manager binary.
223- go build -o bin/manager main.go
223+ go build -o bin/manager cmd/ main.go
224224 go build -o bin/operator cmd/operator/main.go
225225
226226.PHONY : run
@@ -231,7 +231,7 @@ run: export ENABLE_WEBHOOKS?=false
231231run : manifests generate fmt vet # # Run a controller from your host.
232232 /bin/bash hack/clean_local_webhook.sh
233233 source hack/export_related_images.sh && \
234- go run ./main.go -metrics-bind-address " :$( METRICS_PORT) " -health-probe-bind-address " :$( HEALTH_PORT) " -pprof-bind-address " :$( PPROF_PORT) "
234+ go run ./cmd/ main.go -metrics-bind-address " :$( METRICS_PORT) " -health-probe-bind-address " :$( HEALTH_PORT) " -pprof-bind-address " :$( PPROF_PORT) "
235235
236236.PHONY : run-operator
237237run-operator : export METRICS_PORT?=8080
@@ -306,7 +306,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
306306ENVTEST ?= $(LOCALBIN ) /setup-envtest
307307CRD_MARKDOWN ?= $(LOCALBIN ) /crd-to-markdown
308308GINKGO ?= $(LOCALBIN ) /ginkgo
309- GINKGO_TESTS ?= ./tests/... ./apis /client/... ./apis /core/... ./apis /dataplane/... ./pkg /...
309+ GINKGO_TESTS ?= ./tests/... ./api /client/... ./api /core/... ./api /dataplane/... ./internal /...
310310
311311KUTTL ?= $(LOCALBIN ) /kubectl-kuttl
312312
@@ -468,37 +468,37 @@ get-ci-tools:
468468# Run go fmt against code
469469gofmt : get-ci-tools
470470 GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/gofmt.sh
471- GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/gofmt.sh ./apis
471+ GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/gofmt.sh ./api
472472
473473# Run go vet against code
474474govet : get-ci-tools
475475 GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/govet.sh
476- GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/govet.sh ./apis
476+ GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/govet.sh ./api
477477
478478# Run go test against code
479479gotest : test
480480
481481# Run golangci-lint test against code
482482golangci : get-ci-tools
483483 GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/golangci.sh
484- GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/golangci.sh ./apis
484+ GOWORK=off $(CI_TOOLS_REPO_DIR ) /test-runner/golangci.sh ./api
485485
486486# Run go lint against code
487487golint : get-ci-tools
488488 GOWORK=off PATH=$(GOBIN ) :$(PATH ) ; $(CI_TOOLS_REPO_DIR ) /test-runner/golint.sh
489- GOWORK=off PATH=$(GOBIN ) :$(PATH ) ; $(CI_TOOLS_REPO_DIR ) /test-runner/golint.sh ./apis
489+ GOWORK=off PATH=$(GOBIN ) :$(PATH ) ; $(CI_TOOLS_REPO_DIR ) /test-runner/golint.sh ./api
490490
491491.PHONY : gowork
492492gowork : # # Generate go.work file to support our multi module repository
493493 test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION ) go work init
494494 go work use .
495- go work use ./apis
495+ go work use ./api
496496 go work sync
497497
498498.PHONY : operator-lint
499499operator-lint : gowork # # Runs operator-lint
500500 GOBIN=$(LOCALBIN ) go install github.com/gibizer/operator-lint@v0.3.0
501- go vet -vettool=$(LOCALBIN ) /operator-lint ./... ./apis /...
501+ go vet -vettool=$(LOCALBIN ) /operator-lint ./... ./api /...
502502
503503# Used for webhook testing
504504# The configure_local_webhook.sh script below will remove any OLM webhooks
0 commit comments