Skip to content

Commit 3c76aeb

Browse files
committed
Update golang vendor and fix github ci
1 parent 3b97664 commit 3c76aeb

File tree

8 files changed

+30
-29
lines changed

8 files changed

+30
-29
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
build:
55
strategy:
66
matrix:
7-
go-version: [1.17.x, 1.18.x]
7+
go-version: [1.22.x, 1.23.x]
88
goarch: [386, amd64, arm, arm64, ppc64le, s390x]
99
os: [ubuntu-latest] #, macos-latest, windows-latest]
1010
runs-on: ${{ matrix.os }}

.github/workflows/image-build.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,19 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Check out code into the Go module directory
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2828

2929
- name: Set up Docker Buildx
30-
uses: docker/setup-buildx-action@v1
30+
uses: docker/setup-buildx-action@v3
3131

32-
- name: Build container image
33-
uses: docker/build-push-action@v2
34-
with:
35-
context: .
36-
push: false
37-
tags: ghcr.io/${{ github.repository }}:latest-origin
38-
file: Dockerfile.openshift
32+
- name: Download OKD Builder Dockerfile
33+
run: curl https://raw.githubusercontent.com/okd-project/images/main/builder/Dockerfile -o okd-builder.Dockerfile
34+
35+
- name: Create root for builder
36+
run: mkdir root
37+
38+
- name: Organically build golang builder image
39+
run: docker build -t local/okdbuilder:latest -f okd-builder.Dockerfile .
40+
41+
- name: Organically build Multus origin image
42+
run: docker build -t local/multus-cni:latest-origin -f Dockerfile.openshift .

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-version: [1.17.x, 1.18.x]
7+
go-version: [1.22.x, 1.23.x]
88
os: [ubuntu-latest]
99
runs-on: ${{ matrix.os }}
1010
steps:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.o
33
*.a
44
*.so
5+
okd-builder.Dockerfile
56

67
# Folders
78
_obj
@@ -28,5 +29,6 @@ gopath/
2829
.vagrant
2930
.idea
3031
/release-*
32+
root/
3133

3234
*~

Dockerfile

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
# This Dockerfile is used to build the image available on DockerHub
2-
FROM centos:centos7 as build
2+
FROM golang:1.23 AS build
33

44
# Add everything
55
ADD . /usr/src/cni-route-override
66

7-
ENV INSTALL_PKGS "git golang"
8-
RUN rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO && \
9-
curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo && \
10-
yum install -y $INSTALL_PKGS && \
11-
rpm -V $INSTALL_PKGS && \
12-
cd /usr/src/cni-route-override && \
7+
RUN cd /usr/src/cni-route-override && \
138
./build_linux.sh
149

1510
FROM alpine
16-
LABEL org.opencontainers.image.source https://github.com/redhat-nfvpe/cni-route-override
11+
LABEL org.opencontainers.image.source="https://github.com/redhat-nfvpe/cni-route-override"
1712
COPY --from=build /usr/src/cni-route-override/bin/route-override /
1813
WORKDIR /

Dockerfile.openshift

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# This dockerfile is used for building for OpenShift
2-
FROM openshift/origin-release:golang-1.16 as rhel8
1+
# The okd-builder image is locally built from https://raw.githubusercontent.com/okd-project/images/main/okd-builder.Dockerfile
2+
FROM local/okdbuilder:latest AS builder
3+
34
ADD . /usr/src/route-override
45
WORKDIR /usr/src/route-override
56
ENV CGO_ENABLED=0
67
ENV VERSION=rhel8 COMMIT=unset
78
RUN ./build_linux.sh
8-
WORKDIR /
99

10-
FROM openshift/origin-base
11-
LABEL org.opencontainers.image.source https://github.com/redhat-nfvpe/cni-route-override
12-
COPY --from=rhel8 /usr/src/route-override/bin/route-override /usr/src/route-override/bin/route-override
13-
COPY --from=rhel8 /usr/src/route-override/bin/route-override /usr/src/route-override/rhel8/bin/route-override
10+
FROM quay.io/openshift/origin-base:latest
11+
LABEL org.opencontainers.image.source="https://github.com/redhat-nfvpe/cni-route-override"
12+
COPY --from=builder /usr/src/route-override/bin/route-override /usr/src/route-override/bin/route-override
13+
COPY --from=builder /usr/src/route-override/bin/route-override /usr/src/route-override/rhel8/bin/route-override
1414

1515
LABEL io.k8s.display-name="route override CNI" \
1616
io.k8s.description="This is a component of OpenShift Container Platform and provides a CNI plugin to override routes" \

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redhat-nfvpe/cni-route-override
22

3-
go 1.17
3+
go 1.22
44

55
require (
66
github.com/containernetworking/cni v1.1.2
@@ -14,7 +14,7 @@ require (
1414
github.com/fsnotify/fsnotify v1.4.9 // indirect
1515
github.com/nxadm/tail v1.4.8 // indirect
1616
github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect
17-
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
17+
golang.org/x/net v0.31.0 // indirect
1818
golang.org/x/sys v0.5.0 // indirect
1919
golang.org/x/text v0.7.0 // indirect
2020
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ github.com/vishvananda/netlink/nl
6363
# github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc
6464
## explicit
6565
github.com/vishvananda/netns
66-
# golang.org/x/net v0.0.0-20220722155237-a158d28d115b => golang.org/x/net v0.7.0
66+
# golang.org/x/net v0.31.0 => golang.org/x/net v0.7.0
6767
## explicit; go 1.17
6868
golang.org/x/net/html
6969
golang.org/x/net/html/atom

0 commit comments

Comments
 (0)