Skip to content

Commit 17bb30b

Browse files
Fix #210 - Add kubebuilder annotations to preserve metadata fields (#211)
Signed-off-by: Ricardo Zanini <[email protected]>
1 parent 3560eeb commit 17bb30b

12 files changed

+2155
-33
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ bin
33
*.out
44
.vscode
55

6-
# ignore config directory generated by the controller-gen tool
7-
config

Makefile

+25-13
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
addheaders:
2-
@command -v addlicense > /dev/null || go install -modfile=tools.mod -v github.com/google/addlicense
2+
@command -v addlicense > /dev/null || (echo "🚀 Installing addlicense..."; go install -modfile=tools.mod -v github.com/google/addlicense)
33
@addlicense -c "The Serverless Workflow Specification Authors" -l apache .
44

55
fmt:
66
@go vet ./...
77
@go fmt ./...
88

99
goimports:
10-
@command -v goimports > /dev/null || go install golang.org/x/tools/cmd/goimports@latest
10+
@command -v goimports > /dev/null || (echo "🚀 Installing goimports..."; go install golang.org/x/tools/cmd/goimports@latest)
1111
@goimports -w .
1212

13-
1413
lint:
15-
@command -v golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin"
16-
make addheaders
17-
make goimports
18-
make fmt
19-
./hack/go-lint.sh ${params}
14+
@echo "🚀 Running lint..."
15+
@command -v golangci-lint > /dev/null || (echo "🚀 Installing golangci-lint..."; curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin")
16+
@make addheaders
17+
@make goimports
18+
@make fmt
19+
@./hack/go-lint.sh ${params}
20+
@echo "✅ Linting completed!"
2021

2122
.PHONY: test
2223
coverage="false"
2324

2425
test: deepcopy buildergen
25-
make lint
26+
@echo "🧪 Running tests..."
2627
@go test ./...
28+
@echo "✅ Tests completed!"
2729

28-
.PHONY: deepcopy buildergen
2930
deepcopy: $(DEEPCOPY_GEN) ## Download deepcopy-gen locally if necessary.
30-
./hack/deepcopy-gen.sh deepcopy
31+
@echo "📦 Running deepcopy-gen..."
32+
@./hack/deepcopy-gen.sh deepcopy > /dev/null
33+
@make lint
34+
@echo "✅ Deepcopy generation and linting completed!"
3135

3236
buildergen: $(BUILDER_GEN) ## Download builder-gen locally if necessary.
33-
./hack/builder-gen.sh buildergen
37+
@echo "📦 Running builder-gen..."
38+
@./hack/builder-gen.sh buildergen > /dev/null
39+
@make lint
40+
@echo "✅ Builder generation and linting completed!"
3441

3542
.PHONY: kube-integration
3643
kube-integration: controller-gen
37-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
44+
@echo "📦 Generating Kubernetes objects..."
45+
@$(CONTROLLER_GEN) object:headerFile="./hack/boilerplate.txt" paths="./kubernetes/api/..."
46+
@echo "📦 Generating Kubernetes CRDs..."
47+
@$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./kubernetes/..." output:crd:artifacts:config=config/crd/bases
48+
@make lint
49+
@echo "✅ Kubernetes integration completed!"
3850

3951

4052
####################################

0 commit comments

Comments
 (0)