Skip to content

Commit 2d464d0

Browse files
authored
Merge pull request #315 from phoracek/go-121
Bump go to 1.21
2 parents 6f8174b + f7697a5 commit 2d464d0

File tree

8 files changed

+13
-16
lines changed

8 files changed

+13
-16
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(BASE): ; $(info setting GOPATH...)
3737

3838
GOLANGCI = $(GOBIN)/golangci-lint
3939
$(GOBIN)/golangci-lint: | $(BASE) ; $(info building golangci-lint...)
40-
$Q go install -mod=mod github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
40+
$Q go install -mod=mod github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
4141

4242
build: format $(patsubst %, build-%, $(COMPONENTS))
4343

@@ -83,7 +83,6 @@ docker-push:
8383
$(OCI_BIN) push ${TLS_SETTING} ${REGISTRY}/ovs-cni-plugin:${IMAGE_GIT_TAG}
8484

8585
dep: $(GO)
86-
$(GO) mod tidy
8786
$(GO) mod vendor
8887

8988
manifests:

cmd/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/centos/centos:stream8 as builder
1+
FROM quay.io/centos/centos:stream9 as builder
22

33
RUN mkdir /workdir
44
WORKDIR /workdir
@@ -21,7 +21,7 @@ RUN go build -tags no_openssl -o /workdir/bin/marker ./cmd/marker
2121
RUN go build -tags no_openssl -o /workdir/bin/ovs-mirror-producer ./cmd/mirror-producer
2222
RUN go build -tags no_openssl -o /workdir/bin/ovs-mirror-consumer ./cmd/mirror-consumer
2323

24-
FROM registry.access.redhat.com/ubi8/ubi-minimal
25-
RUN microdnf install findutils
24+
FROM registry.access.redhat.com/ubi9/ubi-minimal
25+
RUN microdnf install -y findutils
2626
COPY --from=builder /workdir/.version /.version
2727
COPY --from=builder /workdir/bin/* /

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ replace (
8787
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.1
8888
)
8989

90-
go 1.18
90+
go 1.21

hack/docker-builder/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM quay.io/fedora/fedora:38-x86_64
1+
FROM quay.io/fedora/fedora:40-x86_64
22

33
RUN dnf -y install make git sudo gcc rsync-daemon rsync openvswitch hostname && \
44
dnf -y clean all
55

66
ENV GOPATH="/go"
77
RUN \
88
DESTINATION=/opt && \
9-
VERSION=1.18.4 && \
9+
VERSION=1.21.7 && \
1010
TARBALL=go${VERSION}.linux-amd64.tar.gz && \
1111
URL=https://dl.google.com/go && \
1212
mkdir -p ${DESTINATION} && \

hack/install-go.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -xe
22

33
destination=$1
4-
version=1.18.4
4+
version=1.21.7
55
arch="$(arch | sed s'/aarch64/arm64/' | sed s'/x86_64/amd64/')"
66
tarball=go$version.linux-$arch.tar.gz
77
url=https://dl.google.com/go/

pkg/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package config
1919
import (
2020
"encoding/json"
2121
"fmt"
22-
"io/ioutil"
22+
"io"
2323
"os"
2424
"strings"
2525

@@ -165,7 +165,7 @@ func loadFlatNetConf[T types.NetConfs](configPath string) (*T, error) {
165165
return nil, fmt.Errorf("open ovs config file %s error: %v", confFile, err)
166166
}
167167
defer jsonFile.Close()
168-
jsonBytes, err := ioutil.ReadAll(jsonFile)
168+
jsonBytes, err := io.ReadAll(jsonFile)
169169
if err != nil {
170170
return nil, fmt.Errorf("load ovs config file %s: error: %v", confFile, err)
171171
}

pkg/sriov/cache.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package sriov
2020
import (
2121
"encoding/json"
2222
"fmt"
23-
"io/ioutil"
2423
"os"
2524
"path/filepath"
2625
"strings"
@@ -59,7 +58,7 @@ func saveScratchConf(containerID, dataDir string, conf []byte) error {
5958

6059
path := filepath.Join(dataDir, containerID)
6160

62-
err := ioutil.WriteFile(path, conf, 0600)
61+
err := os.WriteFile(path, conf, 0600)
6362
if err != nil {
6463
return fmt.Errorf("failed to write container data in the path(%q): %v", path, err)
6564
}
@@ -68,7 +67,7 @@ func saveScratchConf(containerID, dataDir string, conf []byte) error {
6867
}
6968

7069
func readScratchConf(cRefPath string) ([]byte, error) {
71-
data, err := ioutil.ReadFile(cRefPath)
70+
data, err := os.ReadFile(cRefPath)
7271
if err != nil {
7372
return nil, fmt.Errorf("failed to read container data in the path(%q): %v", cRefPath, err)
7473
}

pkg/sriov/sriov.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package sriov
1919

2020
import (
2121
"fmt"
22-
"io/ioutil"
2322
"os"
2423
"path/filepath"
2524

@@ -44,7 +43,7 @@ func GetVFLinkName(pciAddr string) (string, error) {
4443
return "", err
4544
}
4645

47-
fInfos, err := ioutil.ReadDir(vfDir)
46+
fInfos, err := os.ReadDir(vfDir)
4847
if err != nil {
4948
return "", fmt.Errorf("failed to read net dir of the device %s: %v", pciAddr, err)
5049
}

0 commit comments

Comments
 (0)