Skip to content

Commit 358f76b

Browse files
authored
Move to go1.19 (#96)
* Move to go1.19 * Fix go1.19 breaking cvhanges * Still allow building with 1.18 * revert space changes on autogen files
1 parent 7c35a26 commit 358f76b

File tree

10 files changed

+20
-18
lines changed

10 files changed

+20
-18
lines changed

.github/workflows/pull_request.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ jobs:
1010
test:
1111
name: test
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go: ['1.18','1.19']
1316
steps:
1417
- uses: actions/checkout@v3
1518
- name: Set up Go
1619
uses: actions/setup-go@v3
1720
with:
18-
go-version: 1.18
21+
go-version: ${{ matrix.go }}
1922
- name: Install make
2023
run: sudo apt -y install make
2124
- name: Run verification and tests

.github/workflows/pull_request_e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: set up go 1.x
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: 1.18
20+
go-version: 1.19
2121
- name: checkout
2222
uses: actions/checkout@v3
2323
- name: run end-to-end tests

.github/workflows/push_image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ env:
1414
jobs:
1515
push-image:
1616
name: push image
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
go: ['1.18']
20+
go: ['1.19']
2121
steps:
2222
- name: install make
2323
run: sudo apt-get install make

.github/workflows/push_image_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
go: ['1.18']
19+
go: ['1.19']
2020
steps:
2121
- name: install make
2222
run: sudo apt-get install make

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-20.04
1717
strategy:
1818
matrix:
19-
go: ['1.18']
19+
go: ['1.19']
2020
steps:
2121
- name: checkout
2222
uses: actions/checkout@v3

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ linters:
2121
- varcheck
2222
linters-settings:
2323
stylecheck:
24-
go: "1.18"
24+
go: "1.19"
2525
gocritic:
2626
enabled-checks:
2727
- hugeParam

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Build the manager binary
2-
FROM registry.access.redhat.com/ubi9/go-toolset:1.18.4 as builder
2+
FROM docker.io/library/golang:1.19 as builder
33

44
ARG SW_VERSION="unknown"
5-
ARG GOVERSION="1.18.4"
65

76
WORKDIR /opt/app-root
87

@@ -20,7 +19,7 @@ COPY Makefile Makefile
2019
RUN make compile
2120

2221
# Create final image from minimal + built binary
23-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1.0
22+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1
2423
WORKDIR /
2524
COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent .
2625
USER 65532:65532

e2e/cluster/kind.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"errors"
1212
"fmt"
1313
"io"
14-
"io/ioutil"
14+
"os"
1515
"path"
1616
"sort"
1717
"testing"
@@ -264,7 +264,7 @@ func deployManifestFile(definition Deployment,
264264
) error {
265265
log.WithField("file", definition.ManifestFile).Info("deploying manifest file")
266266

267-
b, err := ioutil.ReadFile(definition.ManifestFile)
267+
b, err := os.ReadFile(definition.ManifestFile)
268268
if err != nil {
269269
return fmt.Errorf("reading manifest file %q: %w", definition.ManifestFile, err)
270270
}

e2e/cluster/tester/loki.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package tester
33
import (
44
"encoding/json"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"net/url"
99

@@ -33,7 +33,7 @@ func (l *Loki) get(pathQuery string) (status int, body string, err error) {
3333
if err != nil {
3434
return 0, "", err
3535
}
36-
bodyBytes, err := ioutil.ReadAll(resp.Body)
36+
bodyBytes, err := io.ReadAll(resp.Body)
3737
if err != nil {
3838
return resp.StatusCode, "", err
3939
}

pkg/agent/tls.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ package agent
33
import (
44
"crypto/tls"
55
"crypto/x509"
6-
"io/ioutil"
6+
"os"
77
)
88

99
func buildTLSConfig(cfg *Config) (*tls.Config, error) {
1010
tlsConfig := &tls.Config{
1111
InsecureSkipVerify: cfg.KafkaTLSInsecureSkipVerify,
1212
}
1313
if cfg.KafkaTLSCACertPath != "" {
14-
caCert, err := ioutil.ReadFile(cfg.KafkaTLSCACertPath)
14+
caCert, err := os.ReadFile(cfg.KafkaTLSCACertPath)
1515
if err != nil {
1616
return nil, err
1717
}
1818
tlsConfig.RootCAs = x509.NewCertPool()
1919
tlsConfig.RootCAs.AppendCertsFromPEM(caCert)
2020

2121
if cfg.KafkaTLSUserCertPath != "" && cfg.KafkaTLSUserKeyPath != "" {
22-
userCert, err := ioutil.ReadFile(cfg.KafkaTLSUserCertPath)
22+
userCert, err := os.ReadFile(cfg.KafkaTLSUserCertPath)
2323
if err != nil {
2424
return nil, err
2525
}
26-
userKey, err := ioutil.ReadFile(cfg.KafkaTLSUserKeyPath)
26+
userKey, err := os.ReadFile(cfg.KafkaTLSUserKeyPath)
2727
if err != nil {
2828
return nil, err
2929
}

0 commit comments

Comments
 (0)