Skip to content

Commit dd66d41

Browse files
committed
update golang to 1.23 and build crictl from source
Signed-off-by: Mohamed Mahmoud <[email protected]>
1 parent aef5cb1 commit dd66d41

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

.github/workflows/integration_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
strategy:
1616
matrix:
17-
go: ['1.22']
17+
go: ['1.23']
1818
oci_bin: ['docker', 'podman']
1919
env:
2020
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
go: ['1.22']
24+
go: ['1.23']
2525
arch:
2626
- arch: amd64
2727
filename: linux-x86_64
@@ -60,7 +60,7 @@ jobs:
6060
run: make test
6161

6262
- name: Archive Go code coverage results
63-
if: ${{ matrix.arch.arch == 'amd64' && matrix.go == '1.22' }}
63+
if: ${{ matrix.arch.arch == 'amd64' && matrix.go == '1.23' }}
6464
uses: actions/upload-artifact@v4
6565
with:
6666
name: coverage-go

Containerfile.bpfman-agent

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build the manager binary
22
ARG BUILDPLATFORM
33

4-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 AS bpfman-agent-build
4+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS bpfman-agent-build
55

66
# The following ARGs are set internally by docker/build-push-action in github actions
77
ARG TARGETOS
@@ -24,10 +24,30 @@ COPY . .
2424
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
2525
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -mod vendor -o bpfman-agent ./cmd/bpfman-agent/main.go
2626

27+
28+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS cri-tools-build
29+
# The following ARGs are set internally by docker/build-push-action in github actions
30+
ARG TARGETOS
31+
ARG TARGETARCH
32+
ARG TARGETPLATFORM
33+
34+
ARG BUILDPLATFORM
35+
36+
RUN echo "TARGETOS=${TARGETOS} TARGETARCH=${TARGETARCH} BUILDPLATFORM=${BUILDPLATFORM} TARGETPLATFORM=${TARGETPLATFORM}"
37+
38+
WORKDIR /usr/src/cri-tools
39+
ARG CRI_REPO_URL=https://github.com/kubernetes-sigs/cri-tools
40+
ARG CRI_REPO_BRANCH=master
41+
42+
RUN git clone --depth 1 --branch $CRI_REPO_BRANCH $CRI_REPO_URL .
43+
44+
# Build
45+
RUN GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} VERSION="latest" make
46+
RUN cp ./build/bin/${TARGETOS}/${TARGETARCH}/crictl .
47+
2748
# Use the fedora minimal image to reduce the size of the final image but still
2849
# be able to easily install extra packages.
2950
FROM --platform=$TARGETPLATFORM quay.io/fedora/fedora-minimal
30-
ARG DNF_CMD="microdnf"
3151

3252
# The full fedora image can be used for debugging purposes. To use it, comment
3353
# out the FROM and ARG lines above and uncomment the FROM and ARG lines below.
@@ -41,11 +61,7 @@ WORKDIR /
4161
COPY --from=bpfman-agent-build /usr/src/bpfman-operator/bpfman-agent .
4262

4363
# Install crictl
44-
RUN ${DNF_CMD} -y install wget tar gzip ca-certificates
45-
ARG VERSION="v1.31.0"
46-
RUN wget https://github.com/kubernetes-sigs/cri-tools/releases/download/${VERSION}/crictl-${VERSION}-linux-${TARGETARCH}.tar.gz
47-
RUN tar zxvf crictl-${VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin
48-
RUN rm -f crictl-${VERSION}-linux-${TARGETARCH}.tar.gz
49-
RUN ${DNF_CMD} -y clean all
64+
COPY --from=cri-tools-build /usr/src/cri-tools/crictl /usr/local/bin
65+
RUN chmod +x /usr/local/bin/crictl
5066

5167
ENTRYPOINT ["/bpfman-agent"]

Containerfile.bpfman-operator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build the manager binary
22
ARG BUILDPLATFORM
33

4-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 AS bpfman-operator-build
4+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS bpfman-operator-build
55

66
ARG BUILDPLATFORM
77

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
132132
KUSTOMIZE_VERSION ?= v3.8.7
133133
CONTROLLER_TOOLS_VERSION ?= v0.15.0
134134
OPERATOR_SDK_VERSION ?= v1.27.0
135-
GOLANGCI_LINT_VERSION = v1.53.3
135+
GOLANGCI_LINT_VERSION = v1.61.0
136136

137137
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
138138
.PHONY: kustomize

0 commit comments

Comments
 (0)