Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update envtest.md
  • Loading branch information
shintaoku committed Apr 23, 2022
commit 88f9e5849ea63f22c46d923751506605015d4178
12 changes: 10 additions & 2 deletions docs/book/src/reference/envtest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ although it does require `bash` to run.

If you would like to download the tarball containing these binaries,
to use in a disconnected environment for example,
run the following (Kubernetes version 1.21.3 is an example version):
run the following (Kubernetes version 1.21.2 is an example version):

```sh
export K8S_VERSION=1.21.3
export K8S_VERSION=1.21.2
curl -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/test-tools/${K8S_VERSION}/$(go env GOOS)/$(go env GOARCH)"
```

However, in the case of m1 mac using AppleSillicon, the arm64 binary is not yet available, so the test in the Makefile must be changed.
```makefile
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the amd64 working in the AppleSillicon?

Copy link
Author

@shintaoku shintaoku Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you say, there is no kubebuilder-tools supporting darwin/arm64, so using this flag will allow Apple Sillicon to run binaries for intel via Rosseta. (Temporary solution)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shintard,

I checked all that is missing for we support the Apple Silicon and I updated the comment: #1932 (comment)

```

This way, you can use intel binaries. downloaded intel binaries are executed via Rosseta2.

Then install them:

```sh
Expand Down