controller-runtime icon indicating copy to clipboard operation
controller-runtime copied to clipboard

unable to find a version that was supported for platform darwin/arm64

Open ctrought opened this issue 4 years ago • 6 comments

Is controller-runtime tools unsupported on darwin/arm64?

make test
/Users/ct/git/memcached-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/ct/git/memcached-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
go: creating new go.mod: module tmp
Downloading sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
go get: added sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20210906140630-386c2b5b29ba
unable to find a version that was supported for platform darwin/arm64
KUBEBUILDER_ASSETS="" go test ./... -coverprofile cover.out
?   	gitlab.ca/it/ocp/example-operator	[no test files]
?   	gitlab.ca/it/ocp/example-operator/api/v1alpha1	[no test files]
Running Suite: Controller Suite
===============================
Random Seed: 1631198122
Will run 0 of 0 specs

STEP: bootstrapping test environment
2021-09-09T10:35:22.533-0400	DEBUG	controller-runtime.test-env	starting control plane
2021-09-09T10:35:22.536-0400	ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 0, "error": "exec: \"etcd\": executable file not found in $PATH"}

ctrought avatar Sep 09 '21 14:09 ctrought

It looks like there is no kubebuilder-tools that support darwin/arm64. Considering Intel Mac will be replaced by M1 Mac, the darwin/arm64 files must be added in near future. https://storage.googleapis.com/kubebuilder-tools

However, there is a workaround for M1 Mac. If you need to run kubebuilder-tools on M1 Mac, you can just add --arch=amd64option to setup-envtest command to use Intel binaries. The downloaded Intel binaries will run via Rosseta2.

Just modify Makefile's test target generated by kubebuilder:

test: manifests generate fmt vet envtest ## Run tests.
-	KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
+	KUBEBUILDER_ASSETS="$(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

yoichiwo7 avatar Dec 08 '21 04:12 yoichiwo7

Native binaries for darwin/arm64 would be much appreciated!

rmetzger avatar Dec 08 '21 13:12 rmetzger

pushed a PR to init the mitigation of this, you can give a thumb up in here --> https://github.com/kubernetes-sigs/kubebuilder/pull/2516

dntosas avatar Feb 20 '22 07:02 dntosas

when do you plan to release a new version which includes this fix?

avizov avatar Mar 04 '22 14:03 avizov

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 02 '22 15:06 k8s-triage-robot

/remove-lifecycle stale

The latest progress is here: https://github.com/kubernetes-sigs/kubebuilder/issues/1932#issuecomment-1112564792

FillZpp avatar Jun 06 '22 03:06 FillZpp

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 04 '22 04:09 k8s-triage-robot

You can check all available artefacts by looking at: https://storage.googleapis.com/kubebuilder-tools For darwin/arm64 you can use envtest from 1.24 k8s release

Also, if you want to build a project using this environment with Kubebuilder you need to use go/v4-alpha by initing the project with kubebuilder init --plugins=go/v4-alpha OR you must update/customize your scaffold to use kustomize 4.x version instead.

Closing this one as sorted out.

camilamacedo86 avatar Sep 05 '22 11:09 camilamacedo86