Skip to content

Commit 8d8b175

Browse files
Merge pull request #805 from flavianmissi/IR-295
IR-295: upgrade to Go 1.19
2 parents a7d1f05 + 0a3b7d2 commit 8d8b175

File tree

14 files changed

+44
-43
lines changed

14 files changed

+44
-43
lines changed

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: release
33
namespace: openshift
4-
tag: rhel-8-release-golang-1.18-openshift-4.12
4+
tag: rhel-8-release-golang-1.19-openshift-4.12

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.18-openshift-4.12 AS builder
1+
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.12 AS builder
22
WORKDIR /go/src/github.com/openshift/cluster-image-registry-operator
33
COPY . .
44
RUN make build

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PROG := cluster-image-registry-operator
44

55
GOLANGCI_LINT = _output/tools/golangci-lint
66
GOLANGCI_LINT_CACHE = $(PWD)/_output/golangci-lint-cache
7-
GOLANGCI_LINT_VERSION = v1.46.2
7+
GOLANGCI_LINT_VERSION = v1.50.0
88

99
GO_REQUIRED_MIN_VERSION = 1.16
1010

pkg/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
// GetConfig creates a *rest.Config for talking to a Kubernetes apiserver.
2424
// Otherwise will assume running in cluster and use the cluster provided kubeconfig.
2525
//
26-
// Config precedence
26+
// # Config precedence
2727
//
2828
// * KUBECONFIG environment variable pointing at a file
2929
//

pkg/metrics/server_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"crypto/x509"
88
"encoding/pem"
99
"io"
10-
"io/ioutil"
1110
"log"
1211
"math/big"
1312
"net/http"
@@ -64,7 +63,7 @@ func generateTempCertificates() (string, string, error) {
6463
return "", "", err
6564
}
6665

67-
cert, err := ioutil.TempFile("", "testcert-")
66+
cert, err := os.CreateTemp("", "testcert-")
6867
if err != nil {
6968
return "", "", err
7069
}
@@ -77,7 +76,7 @@ func generateTempCertificates() (string, string, error) {
7776
return "", "", err
7877
}
7978

80-
keyPath, err := ioutil.TempFile("", "testkey-")
79+
keyPath, err := os.CreateTemp("", "testkey-")
8180
if err != nil {
8281
return "", "", err
8382
}

pkg/operator/azurestackcloud.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package operator
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
76
"os"
87
"path/filepath"
98
"time"
@@ -110,7 +109,7 @@ func (c *AzureStackCloudController) syncConfig() error {
110109
return err
111110
}
112111

113-
f, err := ioutil.TempFile(filepath.Dir(filename), "azurestackcloud")
112+
f, err := os.CreateTemp(filepath.Dir(filename), "azurestackcloud")
114113
if err != nil {
115114
return err
116115
}

pkg/resource/generator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ func (g *Generator) List(cr *imageregistryv1.Config) ([]Mutator, error) {
118118
// syncStorage checks:
119119
// 1.) to make sure that an existing storage medium still exists and we can access it
120120
// 2.) to see if the storage medium name changed and we need to:
121-
// a.) check to make sure that we can access the storage or
122-
// b.) see if we need to try to create the new storage
121+
//
122+
// a.) check to make sure that we can access the storage or
123+
// b.) see if we need to try to create the new storage
123124
func (g *Generator) syncStorage(cr *imageregistryv1.Config) error {
124125
var runCreate bool
125126
// Create a driver with the current configuration

pkg/storage/gcs/gcs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"context"
66
"encoding/json"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
"strings"
1010
"testing"
@@ -32,7 +32,7 @@ func (r *tripper) RoundTrip(req *http.Request) (*http.Response, error) {
3232
}()
3333
return &http.Response{
3434
StatusCode: r.responseCodes[r.req],
35-
Body: ioutil.NopCloser(bytes.NewBufferString(r.responseBodies[r.req])),
35+
Body: io.NopCloser(bytes.NewBufferString(r.responseBodies[r.req])),
3636
}, nil
3737
}
3838

pkg/storage/ibmcos/ibmcos_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package ibmcos
33
import (
44
"bytes"
55
"context"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"path/filepath"
99
"testing"
@@ -361,7 +361,7 @@ func (r *tripper) RoundTrip(req *http.Request) (*http.Response, error) {
361361
return &http.Response{
362362
StatusCode: r.responseCodes[r.req],
363363
Header: http.Header{"Content-Type": {"application/json"}},
364-
Body: ioutil.NopCloser(bytes.NewBufferString(r.responseBodies[r.req])),
364+
Body: io.NopCloser(bytes.NewBufferString(r.responseBodies[r.req])),
365365
}, nil
366366
}
367367

pkg/storage/oss/oss_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
"reflect"
1010
"testing"
@@ -251,7 +251,7 @@ func (r *tripper) RoundTrip(req *http.Request) (*http.Response, error) {
251251
}()
252252

253253
if req.Body != nil {
254-
dt, err := ioutil.ReadAll(req.Body)
254+
dt, err := io.ReadAll(req.Body)
255255
if err != nil {
256256
return nil, err
257257
}
@@ -269,7 +269,7 @@ func (r *tripper) RoundTrip(req *http.Request) (*http.Response, error) {
269269
}
270270
return &http.Response{
271271
StatusCode: code,
272-
Body: ioutil.NopCloser(bytes.NewBufferString(respBody)),
272+
Body: io.NopCloser(bytes.NewBufferString(respBody)),
273273
}, nil
274274
}
275275

0 commit comments

Comments
 (0)