From 22d9b48ed84376553f9cd6e28113ed66730a13a0 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Wed, 5 Aug 2020 19:30:50 +0100 Subject: [PATCH] feat: envtest setup with docs per project --- .gitignore | 3 + docs/book/src/quick-start.md | 9 +- docs/book/src/reference/envtest.md | 35 +++++++- pkg/plugin/v3/scaffolds/init.go | 12 ++- .../scaffolds/internal/templates/gitignore.go | 1 + .../scaffolds/internal/templates/makefile.go | 9 +- scripts/setup_envtest_bins.sh | 86 ------------------- test.sh | 3 - testdata/project-v3-addon/Makefile | 5 +- testdata/project-v3-multigroup/Makefile | 5 +- testdata/project-v3/Makefile | 5 +- 11 files changed, 70 insertions(+), 103 deletions(-) delete mode 100755 scripts/setup_envtest_bins.sh diff --git a/.gitignore b/.gitignore index 8c3a9d0f52a..ffa5f244dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ docs/book/book/ # skip bin bin/* testbin/* +testdata/project-v3-addon/testbin/* +testdata/project-v3-multigroup/testbin/* +testdata/project-v3/testbin/* # skip .out files (coverage tests) *.out diff --git a/docs/book/src/quick-start.md b/docs/book/src/quick-start.md index b17d107706f..ffd207d94f4 100644 --- a/docs/book/src/quick-start.md +++ b/docs/book/src/quick-start.md @@ -25,7 +25,11 @@ arch=$(go env GOARCH) # download kubebuilder and extract it to tmp curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/ +``` + +If you are using a Kubebuilder plugin version less than version `v3+`, you must configure the Kubernetes binaries required for the [envtest][envtest], run: +```bash # move to a long-term location and put it on your path # (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder @@ -37,7 +41,6 @@ export PATH=$PATH:/usr/local/kubebuilder/bin Also, you can install a master snapshot from `https://go.kubebuilder.io/dl/latest/${os}/${arch}`. -