|
|
@@ -8,17 +8,28 @@ 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
|
|
|
+
|
|
|
+# list available versions
|
|
|
+setup-envtest list --os $(go env GOOS) --arch $(go env GOARCH)
|
|
|
+
|
|
|
+# To use a specific version
|
|
|
+setup-envtest use -p path 1.20.2
|
|
|
|
|
|
-curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$KUBEBUILDER_TOOLS_VERSION-linux-amd64.tar.gz"
|
|
|
+#To set environment variables
|
|
|
+source <(setup-envtest use 1.20.2 -p env --os $(go env GOOS) --arch $(go env GOARCH))
|
|
|
|
|
|
-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
|
|
|
@@ -74,8 +85,15 @@ kind create cluster --name external-secrets
|
|
|
export TAG=v2
|
|
|
export IMAGE=eso-local
|
|
|
|
|
|
+#For building in linux
|
|
|
docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=amd64 --build-arg TARGETOS=linux
|
|
|
|
|
|
+#For building in MacOS (OSX)
|
|
|
+#docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=amd64 --build-arg TARGETOS=darwin
|
|
|
+
|
|
|
+#For building in ARM
|
|
|
+#docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=arm --build-arg TARGETOS=linux
|
|
|
+
|
|
|
make helm.generate
|
|
|
helm upgrade --install external-secrets ./deploy/charts/external-secrets/ --set image.repository=$IMAGE --set image.tag=$TAG
|
|
|
```
|