Fix k3s arm64 binary in offline installer
This commit is contained in:
parent
8dc9d76926
commit
21836c4d7c
@ -76,7 +76,7 @@ jobs:
|
|||||||
needs: build-k3s-installer
|
needs: build-k3s-installer
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
arch: [amd64]
|
arch: [amd64, arm64]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -91,7 +91,19 @@ jobs:
|
|||||||
cd test-dir
|
cd test-dir
|
||||||
tar -xzvf offline-package-k3s-installer-${{ matrix.arch }}.tar.gz
|
tar -xzvf offline-package-k3s-installer-${{ matrix.arch }}.tar.gz
|
||||||
|
|
||||||
|
- name: Verify k3s binary arch
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
BIN="test-dir/k3s-offline-package/bin/k3s-${{ matrix.arch }}"
|
||||||
|
file "$BIN"
|
||||||
|
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||||
|
file "$BIN" | grep -q 'x86-64'
|
||||||
|
else
|
||||||
|
file "$BIN" | grep -q 'aarch64'
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup K3s and Test
|
- name: Setup K3s and Test
|
||||||
|
if: matrix.arch == 'amd64'
|
||||||
run: |
|
run: |
|
||||||
cd test-dir/k3s-offline-package
|
cd test-dir/k3s-offline-package
|
||||||
bash install-server.sh
|
bash install-server.sh
|
||||||
|
|||||||
@ -285,7 +285,11 @@ rm -rf "${BASE_DIR}"
|
|||||||
mkdir -p "${BASE_DIR}/"{bin,images,cni-plugins,addons,registry/docker.io,registry/ghcr.io,install}
|
mkdir -p "${BASE_DIR}/"{bin,images,cni-plugins,addons,registry/docker.io,registry/ghcr.io,install}
|
||||||
|
|
||||||
# 核心二进制
|
# 核心二进制
|
||||||
download "${K3S_URL_BASE}/k3s" "${BASE_DIR}/bin/k3s-${ARCH}"
|
K3S_BIN="k3s"
|
||||||
|
if [[ "${ARCH}" != "amd64" ]]; then
|
||||||
|
K3S_BIN="k3s-${ARCH}"
|
||||||
|
fi
|
||||||
|
download "${K3S_URL_BASE}/${K3S_BIN}" "${BASE_DIR}/bin/k3s-${ARCH}"
|
||||||
chmod +x "${BASE_DIR}/bin/k3s-${ARCH}"
|
chmod +x "${BASE_DIR}/bin/k3s-${ARCH}"
|
||||||
|
|
||||||
download "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" "${BASE_DIR}/bin/kubectl-${ARCH}"
|
download "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" "${BASE_DIR}/bin/kubectl-${ARCH}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user