@@ -12,8 +12,8 @@ BUILD_ARGS ?=
12
12
# Architectures to build images for
13
13
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
14
14
15
- # Go test arguments, e.g. '-tags= integration'
16
- GO_TEST_ARGS ?=
15
+ # Go additional tag arguments, e.g. 'integration'
16
+ GO_TAGS ?=
17
17
18
18
# Produce CRDs that work back to Kubernetes 1.16
19
19
CRD_OPTIONS ?= crd:crdVersions=v1
@@ -41,7 +41,7 @@ export CGO_CFLAGS=-I$(LIBGIT2_PATH)/include -I$(LIBGIT2_PATH)/include/openssl
41
41
# The pkg-config command will yield warning messages until libgit2 is downloaded.
42
42
ifeq ($(shell uname -s) ,Darwin)
43
43
export CGO_LDFLAGS =$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
44
- GO_STATIC_FLAGS =-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
44
+ GO_STATIC_FLAGS =-ldflags "-s -w" -tags 'netgo,osusergo,static_build$( addprefix ,, $( GO_TAGS ) ) '
45
45
else
46
46
export PKG_CONFIG_PATH: =$(PKG_CONFIG_PATH ) :$(LIBGIT2_LIB64_PATH ) /pkgconfig
47
47
export LIBRARY_PATH: =$(LIBRARY_PATH ) :$(LIBGIT2_LIB64_PATH )
@@ -53,14 +53,14 @@ ifeq ($(shell uname -s),Linux)
53
53
ifeq ($(shell uname -m) ,x86_64)
54
54
# Linux x86_64 seem to be able to cope with the static libraries
55
55
# by having only musl-dev installed, without the need of using musl toolchain.
56
- GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
56
+ GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS)) '
57
57
else
58
58
MUSL-PREFIX=$(BUILD_DIR)/musl/$(shell uname -m)-linux-musl-native/bin/$(shell uname -m)-linux-musl
59
59
MUSL-CC=$(MUSL-PREFIX)-gcc
60
60
export CC=$(MUSL-PREFIX)-gcc
61
61
export CXX=$(MUSL-PREFIX)-g++
62
62
export AR=$(MUSL-PREFIX)-ar
63
- GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build'
63
+ GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS)) '
64
64
endif
65
65
endif
66
66
@@ -96,7 +96,7 @@ build: check-deps $(LIBGIT2) ## Build manager binary
96
96
KUBEBUILDER_ASSETS? ="$(shell $(ENVTEST ) --arch=$(ENVTEST_ARCH ) use -i $(ENVTEST_KUBERNETES_VERSION ) --bin-dir=$(ENVTEST_ASSETS_DIR ) -p path) "
97
97
test : $(LIBGIT2 ) install-envtest test-api check-deps # # Run tests
98
98
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS ) \
99
- go test $(GO_STATIC_FLAGS ) $( GO_TEST_ARGS ) ./... -coverprofile cover.out
99
+ go test $(GO_STATIC_FLAGS ) ./... -coverprofile cover.out
100
100
101
101
check-deps :
102
102
ifeq ($(shell uname -s) ,Darwin)
0 commit comments