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
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ help: ## Display this help.
gen-crd: controller-gen ## Generate CRD manifests
$(CONTROLLER_GEN) crd paths="./pkg/apis/runtime/v1alpha1/..." output:crd:artifacts:config=manifests/charts/base/crds

.PHONY: install-crds
install-crds: gen-crd ## Install CRDs into the current Kubernetes cluster
kubectl apply -f manifests/charts/base/crds
Comment on lines +50 to +52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The install-crds target applies CRD manifests from manifests/charts/base/crds. If these manifests have not been generated yet or are outdated, kubectl apply will fail or install stale CRDs. Adding gen-crd as a prerequisite ensures the CRDs are always generated and up-to-date before installation.

.PHONY: install-crds
install-crds: gen-crd ## Install CRDs into the current Kubernetes cluster
	kubectl apply -f manifests/charts/base/crds

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


.PHONY: uninstall-crds
uninstall-crds: ## Remove CRDs from the current Kubernetes cluster
kubectl delete -f manifests/charts/base/crds --ignore-not-found

.PHONY: generate
generate: controller-gen gen-crd ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/apis/..."
Expand Down Expand Up @@ -124,11 +132,27 @@ test:
@echo "Running tests..."
go test -v ./...

.PHONY: test-coverage
test-coverage: ## Run pkg tests with race detector and coverage
go test -race -v -coverprofile=coverage.out -coverpkg=./pkg/... ./pkg/...
go tool cover -func=coverage.out

# Format code
.PHONY: fmt
fmt: ## Format code
@echo "Formatting code..."
go fmt ./...

.PHONY: fmt-check
fmt-check: ## Check Go formatting
@echo "Checking Go formatting..."
@unformatted="$$(gofmt -l .)"; \
if [ -n "$$unformatted" ]; then \
echo "Go files need formatting:"; \
echo "$$unformatted"; \
exit 1; \
fi

.PHONY: vet
vet: ## Run go vet against code.
go vet ./...
Expand All @@ -138,6 +162,14 @@ vet: ## Run go vet against code.
lint: golangci-lint ## Run golangci-lint
$(GOLANGCI_LINT) run ./...

.PHONY: verify
verify: ## Run local verification before submitting PR
$(MAKE) gen-check
$(MAKE) fmt-check
$(MAKE) vet
$(MAKE) lint
$(MAKE) test

# Generate copyright headers
.PHONY: gen-copyright
gen-copyright:
Expand Down Expand Up @@ -255,6 +287,16 @@ docker-push-picod: docker-build-picod
docker tag $(PICOD_IMAGE) $(IMAGE_REGISTRY)/$(PICOD_IMAGE)
docker push $(IMAGE_REGISTRY)/$(PICOD_IMAGE)

##@ Helm

.PHONY: helm-template
helm-template: ## Render Helm chart locally
helm template agentcube manifests/charts/base

.PHONY: helm-lint
helm-lint: ## Lint Helm chart
helm lint manifests/charts/base


##@ Dependencies

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.24.9
require (
github.com/agiledragon/gomonkey/v2 v2.13.0
github.com/alicebob/miniredis/v2 v2.35.0
github.com/gin-contrib/gzip v1.0.1
github.com/fsnotify/fsnotify v1.9.0
github.com/gin-contrib/gzip v1.0.1
github.com/gin-gonic/gin v1.10.0
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/google/uuid v1.6.0
Expand Down
Loading