Skip to content
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

fix(ci): set kubebuilder assets directory #3577

Merged
merged 1 commit into from Dec 20, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions mk/dev.mk
Expand Up @@ -281,4 +281,5 @@ dev/envrc: $(KUBECONFIG_DIR)/kind-kuma-current ## Generate .envrc
@for prog in $(BUILD_RELEASE_BINARIES) $(BUILD_TEST_BINARIES) ; do \
echo "PATH_add $(BUILD_ARTIFACTS_DIR)/$$prog" ; \
done >> .envrc
@echo 'export KUBEBUILDER_ASSETS=$${CI_TOOLS_DIR}' >> .envrc
@direnv allow
8 changes: 4 additions & 4 deletions mk/test.mk
Expand Up @@ -10,10 +10,10 @@ BUILD_COVERAGE_DIR ?= $(BUILD_DIR)/coverage
COVERAGE_PROFILE := $(BUILD_COVERAGE_DIR)/coverage.out
COVERAGE_REPORT_HTML := $(BUILD_COVERAGE_DIR)/coverage.html

# exports below are required for K8S unit tests
export TEST_ASSET_KUBE_APISERVER=$(KUBE_APISERVER_PATH)
export TEST_ASSET_ETCD=$(ETCD_PATH)
export TEST_ASSET_KUBECTL=$(KUBECTL_PATH)
# This environment variable sets where the kubebuilder envtest framework looks
# for etcd and other tools that is consumes. The `dev/install/kubebuilder` make
# target guaranteed to link these tools into $CI_TOOLS_DIR.
export KUBEBUILDER_ASSETS=$(CI_TOOLS_DIR)

.PHONY: test
test: ${COVERAGE_PROFILE} ## Dev: Run tests for all modules
Expand Down
11 changes: 4 additions & 7 deletions pkg/plugins/resources/k8s/native/Makefile
Expand Up @@ -8,13 +8,10 @@ GOPATH_DIR := $(shell go env GOPATH | awk -F: '{print $$1}')
GOPATH_BIN_DIR := $(GOPATH_DIR)/bin
export PATH := $(CI_TOOLS_DIR):$(GOPATH_BIN_DIR):$(PATH)

KUBE_APISERVER_PATH := $(CI_TOOLS_DIR)/kube-apiserver
ETCD_PATH := $(CI_TOOLS_DIR)/etcd
KUBECTL_PATH := $(CI_TOOLS_DIR)/kubectl

export TEST_ASSET_KUBE_APISERVER=$(KUBE_APISERVER_PATH)
export TEST_ASSET_ETCD=$(ETCD_PATH)
export TEST_ASSET_KUBECTL=$(KUBECTL_PATH)
# This environment variable sets where the kubebuilder envtest framework looks
# for etcd and other tools that is consumes. The `dev/install/kubebuilder` make
# target guaranteed to link these tools into $CI_TOOLS_DIR.
export KUBEBUILDER_ASSETS=$(CI_TOOLS_DIR)

CONTROLLER_GEN := go run -mod=mod sigs.k8s.io/controller-tools/cmd/controller-gen
RESOURCE_GEN := go run -mod=mod ../../../../../tools/resource-gen/main.go
Expand Down