Skip to content

Commit b5de559

Browse files
authored
Merge branch 'main' into trivy-scan
2 parents 9e4513a + 670139c commit b5de559

File tree

1,397 files changed

+118444
-52747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,397 files changed

+118444
-52747
lines changed

.github/actions/retest-action/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.17
1+
FROM alpine:3.19
22

33
RUN apk add --no-cache curl jq
44

.github/actions/retest-action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ runs:
88
using: 'docker'
99
image: 'Dockerfile'
1010
env:
11-
GITHUB_TOKEN: ${{ inputs.token }}
11+
GITHUB_TOKEN: ${{ inputs.token }}

.github/dependabot.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "docker" # See documentation for possible values
9-
directory: "/.github/actions/retest-action" # Location of package manifests
8+
- package-ecosystem: "docker" # See documentation for possible values
9+
directory: "/.github/actions/retest-action" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12-
- package-ecosystem: "github-actions" # See documentation for possible values
13-
directory: "/" # Location of package manifests
12+
- package-ecosystem: "github-actions" # See documentation for possible values
13+
directory: "/" # Location of package manifests
1414
schedule:
1515
interval: "weekly"
16-
- package-ecosystem: "gomod" # See documentation for possible values
17-
directory: "/" # Location of package manifests
16+
- package-ecosystem: "gomod" # See documentation for possible values
17+
directory: "/" # Location of package manifests
1818
schedule:
1919
interval: "weekly"
20+
groups:
21+
golang:
22+
patterns:
23+
- "*"

.github/workflows/commands.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check out code
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313

1414
- name: Re-Test Action
1515
uses: ./.github/actions/retest-action

.github/workflows/release.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
name: Release binaries
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
linux_release:
10+
name: Release linux binaries
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
goarch: [amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x]
15+
steps:
16+
- name: Install Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: 1.21
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Build
25+
env:
26+
GOARCH: ${{ matrix.goarch }}
27+
CGO_ENABLED: 0
28+
run: ./build_linux.sh
29+
30+
- name: COPY files
31+
run: cp README.md LICENSE bin/
32+
33+
- name: Create dist directory
34+
run: mkdir dist
35+
36+
- name: Create archive file
37+
working-directory: ./bin
38+
run: tar cfzv ../dist/cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz .
39+
40+
- name: Create sha256 checksum
41+
working-directory: ./dist
42+
run: sha256sum cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha256
43+
44+
- name: Create sha512 checksum
45+
working-directory: ./dist
46+
run: sha512sum cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha512
47+
48+
- name: Upload binaries to release
49+
uses: svenstaro/upload-release-action@v2
50+
with:
51+
repo_token: ${{ secrets.GITHUB_TOKEN }}
52+
file: ./dist/*
53+
tag: ${{ github.ref }}
54+
overwrite: true
55+
file_glob: true
56+
57+
windows_releases:
58+
name: Release windows binaries
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
goarch: [amd64]
63+
steps:
64+
- name: Install dos2unix
65+
run: sudo apt-get install dos2unix
66+
67+
- name: Install Go
68+
uses: actions/setup-go@v5
69+
with:
70+
go-version: 1.21
71+
72+
- name: Checkout code
73+
uses: actions/checkout@v4
74+
75+
- name: Build
76+
env:
77+
GOARCH: ${{ matrix.goarch }}
78+
CGO_ENABLED: 0
79+
run: ./build_windows.sh
80+
81+
- name: COPY files
82+
run: cp README.md LICENSE bin/
83+
84+
- name: Create dist directory
85+
run: mkdir dist
86+
87+
- name: Create archive file
88+
working-directory: ./bin
89+
run: tar cfzv ../dist/cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz .
90+
91+
- name: Create sha256 checksum
92+
working-directory: ./dist
93+
run: sha256sum cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha256
94+
95+
- name: Create sha512 checksum
96+
working-directory: ./dist
97+
run: sha512sum cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha512
98+
99+
- name: Upload binaries to release
100+
uses: svenstaro/upload-release-action@v2
101+
with:
102+
repo_token: ${{ secrets.GITHUB_TOKEN }}
103+
file: ./dist/*
104+
tag: ${{ github.ref }}
105+
overwrite: true
106+
file_glob: true

.github/workflows/stale.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,37 @@ name: test
44
on: ["push", "pull_request"]
55

66
env:
7-
GO_VERSION: "1.18"
7+
GO_VERSION: "1.22"
88
LINUX_ARCHES: "amd64 386 arm arm64 s390x mips64le ppc64le riscv64"
99

1010
jobs:
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: setup go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version-file: go.mod
20+
- uses: ibiqlik/action-yamllint@v3
21+
with:
22+
format: auto
23+
- uses: golangci/golangci-lint-action@v4
24+
with:
25+
version: v1.55.2
26+
args: -v
27+
skip-cache: true
1128
build:
1229
name: Build all linux architectures
30+
needs: lint
1331
runs-on: ubuntu-latest
1432
steps:
33+
- uses: actions/checkout@v4
1534
- name: setup go
16-
uses: actions/setup-go@v3
35+
uses: actions/setup-go@v5
1736
with:
18-
go-version: ${{ env.GO_VERSION }}
19-
- uses: actions/checkout@v3
20-
37+
go-version-file: go.mod
2138
- name: Build on all supported architectures
2239
run: |
2340
set -e
@@ -26,9 +43,9 @@ jobs:
2643
GOARCH=$arch ./build_linux.sh
2744
rm bin/*
2845
done
29-
3046
test-linux:
3147
name: Run tests on Linux amd64
48+
needs: build
3249
runs-on: ubuntu-latest
3350
steps:
3451
- name: Install kernel module
@@ -37,24 +54,21 @@ jobs:
3754
sudo apt-get install linux-modules-extra-$(uname -r)
3855
- name: Install nftables
3956
run: sudo apt-get install nftables
40-
57+
- uses: actions/checkout@v4
4158
- name: setup go
42-
uses: actions/setup-go@v3
59+
uses: actions/setup-go@v5
4360
with:
44-
go-version: ${{ env.GO_VERSION }}
61+
go-version-file: go.mod
4562
- name: Set up Go for root
4663
run: |
4764
sudo ln -sf `which go` `sudo which go` || true
4865
sudo go version
49-
- uses: actions/checkout@v3
5066
5167
- name: Install test binaries
52-
env:
53-
GO111MODULE: off
5468
run: |
55-
go get github.com/containernetworking/cni/cnitool
56-
go get github.com/mattn/goveralls
57-
go get github.com/modocache/gover
69+
go install github.com/containernetworking/cni/cnitool@latest
70+
go install github.com/mattn/goveralls@latest
71+
go install github.com/modocache/gover@latest
5872
5973
- name: test
6074
run: PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 ./test_linux.sh
@@ -66,15 +80,15 @@ jobs:
6680
PATH=$PATH:$(go env GOPATH)/bin
6781
gover
6882
goveralls -coverprofile=gover.coverprofile -service=github
69-
7083
test-win:
7184
name: Build and run tests on Windows
85+
needs: build
7286
runs-on: windows-latest
7387
steps:
88+
- uses: actions/checkout@v4
7489
- name: setup go
75-
uses: actions/setup-go@v3
90+
uses: actions/setup-go@v5
7691
with:
77-
go-version: ${{ env.GO_VERSION }}
78-
- uses: actions/checkout@v3
92+
go-version-file: go.mod
7993
- name: test
8094
run: bash ./test_windows.sh

.golangci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
issues:
2+
exclude-rules:
3+
- linters:
4+
- revive
5+
text: "don't use ALL_CAPS in Go names; use CamelCase"
6+
- linters:
7+
- revive
8+
text: " and that stutters;"
9+
- path: '(.+)_test\.go'
10+
text: "dot-imports: should not use dot imports"
11+
12+
linters:
13+
disable:
14+
- errcheck
15+
enable:
16+
- contextcheck
17+
- durationcheck
18+
- gci
19+
- ginkgolinter
20+
- gocritic
21+
- gofumpt
22+
- gosimple
23+
- govet
24+
- ineffassign
25+
- misspell
26+
- nonamedreturns
27+
- predeclared
28+
- revive
29+
- staticcheck
30+
- unconvert
31+
- unparam
32+
- unused
33+
- wastedassign
34+
35+
linters-settings:
36+
gci:
37+
sections:
38+
- standard
39+
- default
40+
- prefix(github.com/containernetworking)
41+
42+
run:
43+
skip-dirs:
44+
- vendor
45+
timeout: 5m

.yamllint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: default
2+
3+
ignore: |
4+
vendor
5+
6+
rules:
7+
document-start: disable
8+
line-length: disable
9+
truthy:
10+
ignore: |
11+
.github/workflows/*.yml
12+
.github/workflows/*.yaml

build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
set -e
33
cd "$(dirname "$0")"
44

5-
if [ "$(uname)" == "Darwin" ]; then
5+
if [ "$(uname)" = "Darwin" ]; then
66
export GOOS="${GOOS:-linux}"
77
fi
88

0 commit comments

Comments
 (0)