Skip to content

Fix #210 - Add kubebuilder annotations to preserve metadata fields #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ bin
*.out
.vscode

# ignore config directory generated by the controller-gen tool
config
38 changes: 25 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
addheaders:
@command -v addlicense > /dev/null || go install -modfile=tools.mod -v github.com/google/addlicense
@command -v addlicense > /dev/null || (echo "🚀 Installing addlicense..."; go install -modfile=tools.mod -v github.com/google/addlicense)
@addlicense -c "The Serverless Workflow Specification Authors" -l apache .

fmt:
@go vet ./...
@go fmt ./...

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


lint:
@command -v golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin"
make addheaders
make goimports
make fmt
./hack/go-lint.sh ${params}
@echo "🚀 Running lint..."
@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")
@make addheaders
@make goimports
@make fmt
@./hack/go-lint.sh ${params}
@echo "✅ Linting completed!"

.PHONY: test
coverage="false"

test: deepcopy buildergen
make lint
@echo "🧪 Running tests..."
@go test ./...
@echo "✅ Tests completed!"

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

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

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


####################################
Expand Down
Loading
Loading