Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/lints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: actions/checkout@v2
- name: check for replace lines in go.mod files
run: |
! egrep --invert-match -e '^replace.*/api => \./api|^replace.*//allow-merging$' `find . -name 'go.mod'` | egrep -e 'go.mod:replace'
! egrep --invert-match -e '^replace.*/apis => \./apis|^replace.*//allow-merging$' `find . -name 'go.mod'` | egrep -e 'go.mod:replace'
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
.PHONY: manifests
manifests: gowork controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases && \
rm -f api/bases/* && cp -a config/crd/bases api/
rm -f apis/bases/* && cp -a config/crd/bases apis/

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -126,13 +126,13 @@ fmt: ## Run go fmt against code.
.PHONY: vet
vet: gowork ## Run go vet against code.
go vet ./...
go vet ./api/...
go vet ./apis/...


.PHONY: tidy
tidy: ## Run go mod tidy on every mod file in the repo
go mod tidy
cd ./api && go mod tidy
cd ./apis && go mod tidy

.PHONY: golangci-lint
golangci-lint:
Expand All @@ -147,7 +147,7 @@ PROC_CMD = --procs ${PROCS}
test: manifests generate fmt vet envtest ginkgo ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" \
OPERATOR_TEMPLATES="$(PWD)/templates" \
$(GINKGO) --trace --cover --coverpkg=../../pkg/...,../../controllers,../../api/v1beta1 --coverprofile cover.out --covermode=atomic --randomize-all ${PROC_CMD} $(GINKGO_ARGS) ./test/...
$(GINKGO) --trace --cover --coverpkg=../../pkg/...,../../controllers,../../apis/nova/v1beta1,../../apis/placement/v1beta1 --coverprofile cover.out --covermode=atomic --randomize-all ${PROC_CMD} $(GINKGO_ARGS) ./test/...

##@ Build

Expand Down Expand Up @@ -333,36 +333,36 @@ get-ci-tools:
# Run go fmt against code
gofmt: get-ci-tools
$(CI_TOOLS_REPO_DIR)/test-runner/gofmt.sh
$(CI_TOOLS_REPO_DIR)/test-runner/gofmt.sh ./api
$(CI_TOOLS_REPO_DIR)/test-runner/gofmt.sh ./apis

# Run go vet against code
govet: get-ci-tools
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/govet.sh
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/govet.sh ./api
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/govet.sh ./apis

# Run go test against code
gotest: test

# Run golangci-lint test against code
golangci: get-ci-tools
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh ./api
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh ./apis

# Run go lint against code
golint: get-ci-tools
export GOWORK=off && PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh
export GOWORK=off && PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh ./api
export GOWORK=off && PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh ./apis

.PHONY: operator-lint
operator-lint: $(LOCALBIN) gowork ## Runs operator-lint
GOBIN=$(LOCALBIN) go install github.com/gibizer/[email protected]
go vet -vettool=$(LOCALBIN)/operator-lint ./... ./api/...
go vet -vettool=$(LOCALBIN)/operator-lint ./... ./apis/...

.PHONY: gowork
gowork: ## Generate go.work file
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
go work use .
go work use ./api
go work use ./apis
go work sync

OPERATOR_NAMESPACE ?= openstack-operators
Expand Down Expand Up @@ -431,8 +431,8 @@ force-bump: ## Force bump operator and lib-common dependencies
for dep in $$(cat go.mod | grep openstack-k8s-operators | grep -vE -- 'indirect|nova-operator|^replace' | awk '{print $$1}'); do \
go get $$dep@$(BRANCH) ; \
done
for dep in $$(cat api/go.mod | grep openstack-k8s-operators | grep -vE -- 'indirect|nova-operator|^replace' | awk '{print $$1}'); do \
cd ./api && go get $$dep@$(BRANCH) && cd .. ; \
for dep in $$(cat apis/go.mod | grep openstack-k8s-operators | grep -vE -- 'indirect|nova-operator|^replace' | awk '{print $$1}'); do \
cd ./apis && go get $$dep@$(BRANCH) && cd .. ; \
done

PHONY: crd-schema-check
Expand Down
34 changes: 26 additions & 8 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openstack.org
layout:
- go.kubebuilder.io/v3
multigroup: true
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand All @@ -14,7 +19,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaAPI
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -27,7 +32,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaScheduler
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -40,7 +45,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaConductor
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -53,7 +58,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaMetadata
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -66,7 +71,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaNoVNCProxy
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -79,7 +84,7 @@ resources:
domain: openstack.org
group: nova
kind: NovaCell
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -92,7 +97,7 @@ resources:
domain: openstack.org
group: nova
kind: Nova
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -105,7 +110,20 @@ resources:
domain: openstack.org
group: nova
kind: NovaCompute
path: github.com/openstack-k8s-operators/nova-operator/api/v1beta1
path: github.com/openstack-k8s-operators/nova-operator/apis/nova/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: placement
kind: PlacementAPI
path: github.com/openstack-k8s-operators/nova-operator/apis/placement/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand Down
Loading