Skip to content

Commit 3e5f1f6

Browse files
mjudeikis-botmjudeikis-botmjudeikis
authored
fix: add kubectl to hub container image (#133)
* fix: trigger image build on git tag push, not only on GitHub Release The images.yaml workflow only triggered on 'release: types: [created]' which requires a manually created GitHub Release object. Tags created via the git refs API don't create a Release, so image builds never fired. Add 'push: tags: v*' trigger so images build on every version tag. Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: add kubectl to hub container image kubectl is needed for hub operations against tenant clusters. Downloads the latest stable kubectl during image build, matching the target platform architecture (amd64/arm64). Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> --------- Co-authored-by: mjudeikis-bot <ai@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
1 parent 69a27b7 commit 3e5f1f6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

deploy/Dockerfile.hub

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
2121
-o /kedge-hub ./cmd/kedge-hub/
2222

2323
FROM alpine:3.21
24-
RUN apk add --no-cache ca-certificates
24+
ARG TARGETARCH
25+
RUN apk add --no-cache ca-certificates curl && \
26+
KUBECTL_VERSION=$(curl -fsSL https://dl.k8s.io/release/stable.txt) && \
27+
curl -fsSL "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl" -o /usr/local/bin/kubectl && \
28+
chmod +x /usr/local/bin/kubectl
2529
COPY --from=builder /kedge-hub /kedge-hub
2630
USER 65534:65534
2731
ENTRYPOINT ["/kedge-hub"]

0 commit comments

Comments
 (0)