1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

Proposed change to use setup-env

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
This commit is contained in:
Gustavo Carvalho 2022-01-31 08:27:27 -03:00
parent 0766178690
commit 19a7797212

View file

@ -8,25 +8,24 @@ git clone https://github.com/external-secrets/external-secrets.git
cd external-secrets
```
If you want to run controller tests you also need to install kubebuilder's `envtest`:
If you want to run controller tests you also need to install kubebuilder's `envtest`.
The recommended way to do so is to install [setup-envtest](https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest)
Here is an example on how to set it up:
```
export KUBEBUILDER_TOOLS_VERSION='1.20.2' # check for latest version or a version that has support to what you are testing
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
# Using Linux
curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$KUBEBUILDER_TOOLS_VERSION-linux-amd64.tar.gz"
# list available versions
setup-envtest list --os $(go env GOOS) --arch $(go env GOARCH)
# Using MacOS (OSX)
#curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$KUBEBUILDER_TOOLS_VERSION-darwin-amd64.tar.gz"
source <(setup-envtest use 1.21.x -p env --os $(go env GOOS) --arch $(go env GOARCH))
# Using ARM based processors
#curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$KUBEBUILDER_TOOLS_VERSION-linux-arm64.tar.gz"
sudo mkdir -p /usr/local/kubebuilder
sudo tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz
```
for more information, please see [setup-envtest docs](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest)
## Building & Testing
The project uses the `make` build system. It'll run code generators, tests and