Skip to content
Draft
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform

##@ Development

# .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 apis/bases/* && cp -a config/crd/bases apis/

.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/
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./apis/..." paths="./internal/..." paths="./cmd/..." output:crd:artifacts:config=config/crd/bases && \
rm -f apis/bases/* && cp -a config/crd/bases apis/

# .PHONY: generate
# generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
# $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..."

.PHONY: fmt
fmt: ## Run go fmt against code.
Expand All @@ -128,7 +137,7 @@ 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
Expand All @@ -150,7 +159,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=../../internal/...,../../api/v1beta1 --coverprofile cover.out --covermode=atomic --randomize-all ${PROC_CMD} $(GINKGO_ARGS) ./test/...
$(GINKGO) --trace --cover --coverpkg=../../internal/...,../../apis/nova/v1beta1 --coverprofile cover.out --covermode=atomic --randomize-all ${PROC_CMD} $(GINKGO_ARGS) ./test/...

##@ Build

Expand Down Expand Up @@ -359,13 +368,13 @@ golint: get-ci-tools
.PHONY: operator-lint
operator-lint: $(LOCALBIN) gowork ## Runs operator-lint
GOBIN=$(LOCALBIN) go install github.com/gibizer/operator-lint@v0.5.0
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 @@ -435,7 +444,7 @@ 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 \
for dep in $$(cat apis/go.mod | grep openstack-k8s-operators | grep -vE -- 'indirect|nova-operator|^replace' | awk '{print $$1}'); do \
cd ./api && go get $$dep@$(BRANCH) && cd .. ; \
done

Expand Down
29 changes: 21 additions & 8 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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 @@ -31,7 +31,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 @@ -44,7 +44,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 @@ -57,7 +57,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 @@ -70,7 +70,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 @@ -83,7 +83,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 @@ -96,7 +96,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 @@ -109,7 +109,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