This repository was archived by the owner on Apr 25, 2023. It is now read-only.
File tree 3 files changed +32
-6
lines changed
3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ all: container hyperfed controller kubefedctl webhook e2e
76
76
77
77
# Unit tests
78
78
test :
79
- go test $(TEST_PKGS )
79
+ go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
80
+ source <( setup-envtest use -p env 1.21.x) && \
81
+ go test $(TEST_PKGS )
80
82
81
83
build : hyperfed controller kubefedctl webhook
82
84
Original file line number Diff line number Diff line change @@ -34,16 +34,26 @@ help you get started.
34
34
### Binaries
35
35
36
36
The KubeFed deployment depends on ` kubebuilder ` , ` etcd ` , ` kubectl ` , and
37
- ` kube-apiserver ` >= v1.16 being installed in the path. The ` kubebuilder `
38
- ([ v2.3.1] ( https://github.com/kubernetes-sigs/kubebuilder/releases/tag/v2.3.1 )
39
- as of this writing) release packages all of these dependencies together.
37
+ ` kube-apiserver ` >= v1.21. The ` kubebuilder ` release packages all of these
38
+ dependencies together and the ` controller-runtime ` project contains a helper
39
+ utility called ` setup-envtest ` that downloads required binaries and can also
40
+ set up required environment variables (especially ` KUBEBUILDER_ASSETS ` ).
40
41
41
42
These binaries can be installed via the ` download-binaries.sh ` script, which
42
43
downloads them to ` ./bin ` :
43
44
44
45
``` bash
45
46
./scripts/download-binaries.sh
47
+ ```
48
+
49
+ Running make targets will ensure that the ` PATH ` and other environment variables
50
+ are correctly configured for the build itself, but if you wish to configure your
51
+ local shell in the same way then run the following commands after running the
52
+ ` download-binaries.sh ` script above:
53
+
54
+ ``` bash
46
55
export PATH=$( pwd) /bin:${PATH}
56
+ source <( setup-envtest use -p env 1.21.x)
47
57
```
48
58
49
59
### kubernetes
Original file line number Diff line number Diff line change @@ -49,15 +49,29 @@ kb_url="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${kb_v
49
49
curl " ${curl_args} " " ${kb_url} " \
50
50
| tar xzP -C " ${dest_dir} " --strip-components=2
51
51
52
- export KUBEBUILDER_ASSETS=" ${dest_dir} "
53
- echo " Setting to KUBEBUILDER_ASSETS ${dest_dir} "
52
+ go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
53
+ source <( setup-envtest use -p env 1.21.x)
54
+
55
+ echo " KUBEBUILDER_ASSETS is set to ${KUBEBUILDER_ASSETS} "
54
56
55
57
helm_version=" 3.6.0"
56
58
helm_tgz=" helm-v${helm_version} -${platform} -amd64.tar.gz"
57
59
helm_url=" https://get.helm.sh/$helm_tgz "
58
60
curl " ${curl_args} " " ${helm_url} " \
59
61
| tar xzP -C " ${dest_dir} " --strip-components=1 " ${platform} -amd64/helm"
60
62
63
+ kubectl_version=" v1.21.14"
64
+ curl -Lo " ${dest_dir} /kubectl" " https://dl.k8s.io/release/${kubectl_version} /bin/${platform} /amd64/kubectl"
65
+ (cd " ${dest_dir} " && \
66
+ echo " $( curl -L " https://dl.k8s.io/release/${kubectl_version} /bin/${platform} /amd64/kubectl.sha256" ) kubectl" | \
67
+ sha256sum --check
68
+ )
69
+ chmod +x " ${dest_dir} /kubectl"
70
+
71
+ kubebuilder_version=" 2.3.2"
72
+ curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${kubebuilder_version} /kubebuilder_${kubebuilder_version} _${platform} _amd64.tar.gz | \
73
+ tar xzP -C " ${dest_dir} " --strip-components=2 -- " kubebuilder_${kubebuilder_version} _${platform} _amd64/bin/kubebuilder"
74
+
61
75
golint_version=" 1.40.1"
62
76
golint_dir=" golangci-lint-${golint_version} -${platform} -amd64"
63
77
golint_tgz=" ${golint_dir} .tar.gz"
You can’t perform that action at this time.
0 commit comments