forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (62 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
include ../Makefile.defs
# Determines if the eBPF unit tests are ran with `sudo`
RUN_WITH_SUDO ?= true
ifeq ($(RUN_WITH_SUDO), true)
RUN_WITH_SUDO=-exec sudo
else
RUN_WITH_SUDO=
endif
PROVISION ?= true
# If you set provision to false the test will run without bootstrapping the
# cluster again.
HOLD_ENVIRONMENT ?= true
TEST_ARTIFACTS = ./tmp.yaml ./*_service_manifest.json ./*_manifest.yaml
TEST_ARTIFACTS += ./*_policy.json ./k8s-*.xml ./runtime.xml ./test_results
TEST_ARTIFACTS += ./test.test
NETNEXT ?= false
KUBEPROXY ?= 1
NO_CILIUM_ON_NODES ?= ""
GINKGO = $(QUIET) ginkgo
REGISTRY_CREDENTIALS ?= "${DOCKER_LOGIN}:${DOCKER_PASSWORD}"
.PHONY = all build test run k8s-test k8s-kind clean
all: build
build:
@$(ECHO_GINKGO)$@
$(GINKGO) build
$(QUIET)$(MAKE) -C bpf/
build-darwin:
@$(ECHO_GINKGO)$@
GOOS=darwin $(GINKGO) build
test: run k8s-test
run:
INTEGRATION_TESTS=true KERNEL=net-next ginkgo --focus "Runtime" -v -- --cilium.provision=$(PROVISION) --cilium.registryCredentials=$(REGISTRY_CREDENTIALS)
k8s-test:
INTEGRATION_TESTS=true ginkgo --focus "K8s" -v -- --cilium.provision=$(PROVISION) --cilium.registryCredentials=$(REGISTRY_CREDENTIALS)
# Match kind-image target in parent directory
k8s-kind: export DOCKER_REGISTRY=localhost:5000
k8s-kind:
@if [ -z "$(FOCUS)" ]; then \
>&2 echo "usage: FOCUS=K8sFoo make k8s-kind"; \
exit 1; \
fi
@CNI_INTEGRATION=kind \
K8S_VERSION="$$(kubectl version -o json | jq -r '.serverVersion | "\(.major).\(.minor)"')" \
NETNEXT="$(NETNEXT)" \
KUBEPROXY="$(KUBEPROXY)" \
NO_CILIUM_ON_NODES="$(NO_CILIUM_ON_NODES)" \
INTEGRATION_TESTS=true ginkgo --focus "$(FOCUS)" -v -- \
-cilium.testScope=k8s \
-cilium.provision=false \
-cilium.kubeconfig=$$(echo ~/.kube/config) \
-cilium.passCLIEnvironment=true \
-cilium.image="$(DOCKER_REGISTRY)/cilium/cilium-dev" \
-cilium.tag="local" \
-cilium.operator-image="quay.io/cilium/operator" \
-cilium.operator-suffix="-ci" \
-cilium.holdEnvironment=$(HOLD_ENVIRONMENT)
clean:
@$(ECHO_CLEAN)
-$(QUIET) rm -rf $(TEST_ARTIFACTS)
-$(QUIET)$(MAKE) -C bpf/ clean