mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
build: add architecture detection to CNI makefile target (#26877)
The 'cni' make target was hardcoded to download amd64 CNI plugins, which prevented users on arm64/aarch64 systems from using this target. This change adds automatic architecture detection that maps the system architecture (from uname -m) to the appropriate CNI plugin architecture: - x86_64 -> amd64 (existing behavior) - aarch64 -> arm64 (new support) The implementation uses the existing THIS_ARCH variable already defined in the Makefile, ensuring consistency with other build targets. Fixes #26864
This commit is contained in:
@@ -477,6 +477,8 @@ copywriteheaders:
|
|||||||
|
|
||||||
.PHONY: cni
|
.PHONY: cni
|
||||||
cni: ## Install CNI plugins. Run this as root.
|
cni: ## Install CNI plugins. Run this as root.
|
||||||
|
@# Detect architecture: x86_64 -> amd64, aarch64 -> arm64
|
||||||
|
$(eval CNI_ARCH := $(shell if [ "$(THIS_ARCH)" = "aarch64" ]; then echo "arm64"; else echo "amd64"; fi))
|
||||||
mkdir -p /opt/cni/bin
|
mkdir -p /opt/cni/bin
|
||||||
curl --fail -LsO "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz"
|
curl --fail -LsO "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-$(CNI_ARCH)-v1.3.0.tgz"
|
||||||
tar -C /opt/cni/bin -xf cni-plugins-linux-amd64-v1.3.0.tgz
|
tar -C /opt/cni/bin -xf cni-plugins-linux-$(CNI_ARCH)-v1.3.0.tgz
|
||||||
|
|||||||
Reference in New Issue
Block a user