Skip to content
Snippets Groups Projects
Unverified Commit 358f76b4 authored by Joel Takvorian's avatar Joel Takvorian Committed by GitHub
Browse files

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
parent 7c35a264
No related branches found
No related tags found
No related merge requests found
...@@ -10,12 +10,15 @@ jobs: ...@@ -10,12 +10,15 @@ jobs:
test: test:
name: test name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.18','1.19']
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.18 go-version: ${{ matrix.go }}
- name: Install make - name: Install make
run: sudo apt -y install make run: sudo apt -y install make
- name: Run verification and tests - name: Run verification and tests
......
...@@ -17,7 +17,7 @@ jobs: ...@@ -17,7 +17,7 @@ jobs:
- name: set up go 1.x - name: set up go 1.x
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.18 go-version: 1.19
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: run end-to-end tests - name: run end-to-end tests
......
...@@ -14,10 +14,10 @@ env: ...@@ -14,10 +14,10 @@ env:
jobs: jobs:
push-image: push-image:
name: push image name: push image
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go: ['1.18'] go: ['1.19']
steps: steps:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
......
...@@ -16,7 +16,7 @@ jobs: ...@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go: ['1.18'] go: ['1.19']
steps: steps:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
......
...@@ -16,7 +16,7 @@ jobs: ...@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
go: ['1.18'] go: ['1.19']
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
......
...@@ -21,7 +21,7 @@ linters: ...@@ -21,7 +21,7 @@ linters:
- varcheck - varcheck
linters-settings: linters-settings:
stylecheck: stylecheck:
go: "1.18" go: "1.19"
gocritic: gocritic:
enabled-checks: enabled-checks:
- hugeParam - hugeParam
......
# Build the manager binary # Build the manager binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.18.4 as builder FROM docker.io/library/golang:1.19 as builder
ARG SW_VERSION="unknown" ARG SW_VERSION="unknown"
ARG GOVERSION="1.18.4"
WORKDIR /opt/app-root WORKDIR /opt/app-root
...@@ -20,7 +19,7 @@ COPY Makefile Makefile ...@@ -20,7 +19,7 @@ COPY Makefile Makefile
RUN make compile RUN make compile
# Create final image from minimal + built binary # Create final image from minimal + built binary
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1.0 FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1
WORKDIR / WORKDIR /
COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent . COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent .
USER 65532:65532 USER 65532:65532
......
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil" "os"
"path" "path"
"sort" "sort"
"testing" "testing"
...@@ -264,7 +264,7 @@ func deployManifestFile(definition Deployment, ...@@ -264,7 +264,7 @@ func deployManifestFile(definition Deployment,
) error { ) error {
log.WithField("file", definition.ManifestFile).Info("deploying manifest file") log.WithField("file", definition.ManifestFile).Info("deploying manifest file")
b, err := ioutil.ReadFile(definition.ManifestFile) b, err := os.ReadFile(definition.ManifestFile)
if err != nil { if err != nil {
return fmt.Errorf("reading manifest file %q: %w", definition.ManifestFile, err) return fmt.Errorf("reading manifest file %q: %w", definition.ManifestFile, err)
} }
......
...@@ -3,7 +3,7 @@ package tester ...@@ -3,7 +3,7 @@ package tester
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io"
"net/http" "net/http"
"net/url" "net/url"
...@@ -33,7 +33,7 @@ func (l *Loki) get(pathQuery string) (status int, body string, err error) { ...@@ -33,7 +33,7 @@ func (l *Loki) get(pathQuery string) (status int, body string, err error) {
if err != nil { if err != nil {
return 0, "", err return 0, "", err
} }
bodyBytes, err := ioutil.ReadAll(resp.Body) bodyBytes, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
return resp.StatusCode, "", err return resp.StatusCode, "", err
} }
......
...@@ -3,7 +3,7 @@ package agent ...@@ -3,7 +3,7 @@ package agent
import ( import (
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"io/ioutil" "os"
) )
func buildTLSConfig(cfg *Config) (*tls.Config, error) { func buildTLSConfig(cfg *Config) (*tls.Config, error) {
...@@ -11,7 +11,7 @@ func buildTLSConfig(cfg *Config) (*tls.Config, error) { ...@@ -11,7 +11,7 @@ func buildTLSConfig(cfg *Config) (*tls.Config, error) {
InsecureSkipVerify: cfg.KafkaTLSInsecureSkipVerify, InsecureSkipVerify: cfg.KafkaTLSInsecureSkipVerify,
} }
if cfg.KafkaTLSCACertPath != "" { if cfg.KafkaTLSCACertPath != "" {
caCert, err := ioutil.ReadFile(cfg.KafkaTLSCACertPath) caCert, err := os.ReadFile(cfg.KafkaTLSCACertPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -19,11 +19,11 @@ func buildTLSConfig(cfg *Config) (*tls.Config, error) { ...@@ -19,11 +19,11 @@ func buildTLSConfig(cfg *Config) (*tls.Config, error) {
tlsConfig.RootCAs.AppendCertsFromPEM(caCert) tlsConfig.RootCAs.AppendCertsFromPEM(caCert)
if cfg.KafkaTLSUserCertPath != "" && cfg.KafkaTLSUserKeyPath != "" { if cfg.KafkaTLSUserCertPath != "" && cfg.KafkaTLSUserKeyPath != "" {
userCert, err := ioutil.ReadFile(cfg.KafkaTLSUserCertPath) userCert, err := os.ReadFile(cfg.KafkaTLSUserCertPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }
userKey, err := ioutil.ReadFile(cfg.KafkaTLSUserKeyPath) userKey, err := os.ReadFile(cfg.KafkaTLSUserKeyPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment