@@ -36,7 +36,6 @@ ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
3636else ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),aarch64 arm))
3737 TARGET_ARCH := arm64
3838endif
39- $(info Auto-detected system architecture : $(TARGET_ARCH ) )
4039endif
4140endif
4241
@@ -63,7 +62,7 @@ CONTROLLER_GEN_VER := v0.16.0
6362CONTROLLER_GEN_BIN := controller-gen
6463CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR ) /$(CONTROLLER_GEN_BIN ) -$(CONTROLLER_GEN_VER ) )
6564
66- STATICCHECK_VER := master
65+ STATICCHECK_VER := v0.6.1
6766STATICCHECK_BIN := staticcheck
6867STATICCHECK := $(abspath $(TOOLS_BIN_DIR ) /$(STATICCHECK_BIN ) -$(STATICCHECK_VER ) )
6968
@@ -76,9 +75,9 @@ GOLANGCI_LINT_BIN := golangci-lint
7675GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) -$(GOLANGCI_LINT_VER ) )
7776
7877# ENVTEST_K8S_VERSION refers to the version of k8s binary assets to be downloaded by envtest binary.
79- ENVTEST_K8S_VERSION = 1.30 .0
78+ ENVTEST_K8S_VERSION = 1.33 .0
8079# ENVTEST_VER is the version of the ENVTEST binary
81- ENVTEST_VER = v0.0.0-20240317073005-bd9ea79e8d18
80+ ENVTEST_VER = release-0.22
8281ENVTEST_BIN := setup-envtest
8382ENVTEST := $(abspath $(TOOLS_BIN_DIR ) /$(ENVTEST_BIN ) -$(ENVTEST_VER ) )
8483
@@ -182,19 +181,26 @@ test: manifests generate fmt vet local-unit-test integration-test ## Run unit te
182181
183182# #
184183# Set up the timeout parameters as some of the tests (rollout controller) lengths have exceeded the default 10 minute mark.
185- # TO-DO (chenyu1): enable parallelization for single package integration tests.
184+ # Note: this recipe runs both unit tests and integration tests under the pkg/ directory .
186185.PHONY : local-unit-test
187186local-unit-test : $(ENVTEST ) # # Run unit tests
188187 export CGO_ENABLED=1 && \
189188 export KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " && \
190189 go test ` go list ./pkg/... ./cmd/...` -race -coverpkg=./... -coverprofile=ut-coverage.xml -covermode=atomic -v -timeout=30m
191190
191+ # Note: this recipe runs the integration tests under the /test/scheduler and /test/apis/ directories with the Ginkgo CLI.
192192.PHONY : integration-test
193193integration-test : $(ENVTEST ) # # Run integration tests
194194 export CGO_ENABLED=1 && \
195195 export KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " && \
196- ginkgo -v -p --race --cover --coverpkg=./pkg/scheduler/... ./test/scheduler && \
197- ginkgo -v -p --race --cover --coverpkg=./... ./test/apis/...
196+ ginkgo -v -p --race --cover --coverpkg=./pkg/scheduler/... -coverprofile=scheduler-it.out ./test/scheduler && \
197+ ginkgo -v -p --race --cover --coverpkg=./apis/ -coverprofile=api-validation-it.out ./test/apis/...
198+
199+ .PHONY : kubebuilder-assets-path
200+ kubebuilder-assets-path : $(ENVTEST ) # # Get the path to kubebuilder assets
201+ @export CGO_ENABLED=1 && \
202+ export KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " && \
203+ echo $$ KUBEBUILDER_ASSETS
198204
199205# # local tests & e2e tests
200206
@@ -282,6 +288,14 @@ BUILDKIT_VERSION ?= v0.18.1
282288push : # # Build and push all Docker images
283289 $(MAKE ) OUTPUT_TYPE=" type=registry" docker-build-hub-agent docker-build-member-agent docker-build-refresh-token docker-build-crd-installer
284290
291+ .PHONY : helm-push
292+ helm-push : # # Package and push Helm charts to OCI registry
293+ helm package charts/hub-agent --version $(TAG ) --app-version $(TAG ) --destination .helm-packages
294+ helm package charts/member-agent --version $(TAG ) --app-version $(TAG ) --destination .helm-packages
295+ helm push .helm-packages/hub-agent-$(TAG ) .tgz oci://$(REGISTRY )
296+ helm push .helm-packages/member-agent-$(TAG ) .tgz oci://$(REGISTRY )
297+ rm -rf .helm-packages
298+
285299# By default, docker buildx create will pull image moby/buildkit:buildx-stable-1 and hit the too many requests error
286300#
287301# Note (chenyu1): the step below sets up emulation for building/running non-native binaries on the host. The original
@@ -300,6 +314,7 @@ push: ## Build and push all Docker images
300314# On some systems the emulation setup might not work at all (e.g., macOS on Apple Silicon -> Rosetta 2 will be used
301315# by Docker Desktop as the default emulation option for AMD64 on ARM64 container compatibility).
302316docker-buildx-builder :
317+ $(info Auto-detected system architecture: $(TARGET_ARCH ) )
303318 @if ! docker buildx ls | grep $(BUILDX_BUILDER_NAME ) ; then \
304319 if [ " $( TARGET_ARCH) " = " amd64" ] ; then \
305320 echo " The target is an x86_64 platform; setting up emulation for other known architectures" ; \
0 commit comments