✨ For kubebuilder-tools : add support to darwin/arm64, and other future OS/Arch asset bundles + etcd #2762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch updates the Dockerfile used to produce the kubebuilder asset bundle to support darwin/arm64, as well as possible, other, future OS/Architecture combinations, with support for building etcd as well.
This patch will build kubectl and etcd from source in the case either is not found using their prebuilt URL locations.
Testing includes:
Building the asset bundle:
Copying the produced asset tarball out of the container image:
Verifying the contents of the tarball:
Update 1
I decided to validate it again using
--no-cache
when building the image, and it still works as expected:$ tar xzf kubebuilder_darwin_arm64.tar.gz $ file kubebuilder/bin/* kubebuilder/bin/etcd: Mach-O 64-bit executable arm64 kubebuilder/bin/kube-apiserver: Mach-O 64-bit executable arm64 kubebuilder/bin/kubectl: Mach-O 64-bit executable arm64 $ ./kubebuilder/bin/etcd --version etcd Version: 3.5.4 Git SHA: 08407ff Go Version: go1.18.3 Go OS/Arch: darwin/arm64