Skip to content

Commit 61d715d

Browse files
committed
Re-add arm support and fix target arch for non-amd64 platforms
Signed-off-by: Brad Davidson <[email protected]>
1 parent ac09a00 commit 61d715d

File tree

8 files changed

+20
-18
lines changed

8 files changed

+20
-18
lines changed

.github/workflows/pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [linux]
20-
arch: [amd64, arm64]
20+
arch: [amd64, arm64, arm]
2121
steps:
2222
- name: Add Git
2323
run: apk add -U git

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
os: [linux]
24-
arch: [amd64, arm64]
24+
arch: [amd64, arm64, arm]
2525
steps:
2626
- name: Add Git
2727
run: apk add -U git
@@ -138,4 +138,4 @@ jobs:
138138
tags: rancher/system-upgrade-controller:${{ env.TAG }}
139139
file: package/Dockerfile
140140
target: controller
141-
platforms: linux/amd64, linux/arm64
141+
platforms: linux/amd64, linux/arm64, linux/arm

Dockerfile.dapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \
1717
chmod +x /usr/local/bin/docker-compose; \
1818
fi
1919
RUN mkdir -p /usr/local/lib/docker/cli-plugins; \
20-
curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-${ARCH}"; \
20+
curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64"; \
2121
chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx
2222
ENV DAPPER_ENV REPO TAG DRONE_TAG
2323
ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/

scripts/build-controller

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ mkdir -p bin
99
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s"
1010
echo "Building $PKG ..."
1111
VERSIONFLAGS="-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8}"
12-
CGO_ENABLED=0 go build -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller
12+
CGO_ENABLED=0 GOARCH=$ARCH go build -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller

scripts/build-e2e-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ mkdir -p bin
99
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s"
1010
echo "Building $PKG/e2e ..."
1111
VERSIONFLAGS="-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8}"
12-
CGO_ENABLED=0 go test -c -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller.test ./e2e/suite/...
12+
CGO_ENABLED=0 GOARCH=$ARCH go test -c -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller.test ./e2e/suite/...

scripts/package-controller

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source $(dirname $0)/version
66
cd $(dirname $0)/..
77

88
docker buildx build \
9-
--build-arg TARGETARCH=${ARCH} \
9+
--platform linux/${ARCH} \
1010
--build-arg REPO=${REPO} \
1111
--build-arg TAG=${TAG} \
1212
--build-arg VERSION=${VERSION} \

scripts/package-e2e-tests

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ source $(dirname $0)/version
55

66
cd $(dirname $0)/..
77

8+
if [ "$ARCH" != "amd64" ]; then
9+
exit 0
10+
fi
11+
812
docker buildx build \
9-
--build-arg TARGETARCH=${ARCH} \
13+
--platform linux/${ARCH} \
1014
--build-arg REPO=${REPO} \
1115
--build-arg TAG=${TAG} \
1216
--build-arg VERSION=${VERSION} \
@@ -24,11 +28,9 @@ docker image save --output ./dist/artifacts/system-upgrade-controller-e2e-tests-
2428
echo ${REPO}/system-upgrade-controller:${TAG}-e2e-tests >> ./dist/images.txt
2529
echo Built ${REPO}/system-upgrade-controller:${TAG}-e2e-tests
2630

27-
if [ "$ARCH" = "amd64" ]; then
28-
sonobuoy gen plugin \
29-
--format=junit \
30-
--image ${REPO}/system-upgrade-controller:${VERSION}-e2e-tests \
31-
--name system-upgrade-controller \
32-
--type job \
33-
> ./dist/artifacts/system-upgrade-controller-e2e-tests.yaml
34-
fi
31+
sonobuoy gen plugin \
32+
--format=junit \
33+
--image ${REPO}/system-upgrade-controller:${VERSION}-e2e-tests \
34+
--name system-upgrade-controller \
35+
--type job \
36+
> ./dist/artifacts/system-upgrade-controller-e2e-tests.yaml

scripts/validate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ set -e
33

44
cd $(dirname $0)/..
55

6-
echo Running validation
7-
86
PACKAGES="$(go list ./...)"
97

8+
file bin/*
9+
1010
if ! command -v golangci-lint; then
1111
echo Skipping validation: no golangci-lint available
1212
exit

0 commit comments

Comments
 (0)