Skip to content

Commit

Permalink
Bump go to 1.21
Browse files Browse the repository at this point in the history
Go 1.18 is old and no longer available in CentOS repositories.

Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Jun 3, 2024
1 parent 6f8174b commit 26594dc
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $(BASE): ; $(info setting GOPATH...)

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

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

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

dep: $(GO)
$(GO) mod tidy
$(GO) mod vendor

manifests:
Expand Down
2 changes: 1 addition & 1 deletion cmd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/centos/centos:stream8 as builder
FROM quay.io/centos/centos:stream9 as builder

RUN mkdir /workdir
WORKDIR /workdir
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ replace (
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.1
)

go 1.18
go 1.21
4 changes: 2 additions & 2 deletions hack/docker-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM quay.io/fedora/fedora:38-x86_64
FROM quay.io/fedora/fedora:40-x86_64

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

ENV GOPATH="/go"
RUN \
DESTINATION=/opt && \
VERSION=1.18.4 && \
VERSION=1.21.7 && \
TARBALL=go${VERSION}.linux-amd64.tar.gz && \
URL=https://dl.google.com/go && \
mkdir -p ${DESTINATION} && \
Expand Down
2 changes: 1 addition & 1 deletion hack/install-go.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

destination=$1
version=1.18.4
version=1.21.7
arch="$(arch | sed s'/aarch64/arm64/' | sed s'/x86_64/amd64/')"
tarball=go$version.linux-$arch.tar.gz
url=https://dl.google.com/go/
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package config
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"strings"

Expand Down Expand Up @@ -165,7 +165,7 @@ func loadFlatNetConf[T types.NetConfs](configPath string) (*T, error) {
return nil, fmt.Errorf("open ovs config file %s error: %v", confFile, err)
}
defer jsonFile.Close()
jsonBytes, err := ioutil.ReadAll(jsonFile)
jsonBytes, err := io.ReadAll(jsonFile)
if err != nil {
return nil, fmt.Errorf("load ovs config file %s: error: %v", confFile, err)
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/sriov/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package sriov
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -59,7 +58,7 @@ func saveScratchConf(containerID, dataDir string, conf []byte) error {

path := filepath.Join(dataDir, containerID)

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

func readScratchConf(cRefPath string) ([]byte, error) {
data, err := ioutil.ReadFile(cRefPath)
data, err := os.ReadFile(cRefPath)
if err != nil {
return nil, fmt.Errorf("failed to read container data in the path(%q): %v", cRefPath, err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/sriov/sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package sriov

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -44,7 +43,7 @@ func GetVFLinkName(pciAddr string) (string, error) {
return "", err
}

fInfos, err := ioutil.ReadDir(vfDir)
fInfos, err := os.ReadDir(vfDir)
if err != nil {
return "", fmt.Errorf("failed to read net dir of the device %s: %v", pciAddr, err)
}
Expand Down

0 comments on commit 26594dc

Please sign in to comment.