Skip to content

Commit b28f11f

Browse files
authored
Merge pull request #1184 from apricote/fix-ci-go-18
🐛 upgrade golangci-lint for go 1.18 support
2 parents 66a2cde + cae44b1 commit b28f11f

File tree

8 files changed

+233
-113
lines changed

8 files changed

+233
-113
lines changed

api/v1alpha3/openstackcluster_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const (
3030

3131
// OpenStackClusterSpec defines the desired state of OpenStackCluster.
3232
type OpenStackClusterSpec struct {
33-
3433
// The name of the secret containing the openstack credentials
3534
// +optional
3635
// +k8s:conversion-gen=false

api/v1alpha3/openstackmachine_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ type OpenStackMachineSpec struct {
9494

9595
// OpenStackMachineStatus defines the observed state of OpenStackMachine.
9696
type OpenStackMachineStatus struct {
97-
9897
// Ready is true when the provider resource is ready.
9998
// +optional
10099
Ready bool `json:"ready"`

api/v1alpha4/openstackmachine_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ type OpenStackMachineSpec struct {
9494

9595
// OpenStackMachineStatus defines the observed state of OpenStackMachine.
9696
type OpenStackMachineStatus struct {
97-
9897
// Ready is true when the provider resource is ready.
9998
// +optional
10099
Ready bool `json:"ready"`

api/v1beta1/openstackmachine_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ type OpenStackMachineSpec struct {
9898

9999
// OpenStackMachineStatus defines the observed state of OpenStackMachine.
100100
type OpenStackMachineStatus struct {
101-
102101
// Ready is true when the provider resource is ready.
103102
// +optional
104103
Ready bool `json:"ready"`

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require (
1414
github.com/prometheus/client_golang v1.11.0
1515
github.com/spf13/pflag v1.0.5
1616
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
17+
golang.org/x/text v0.3.7
1718
gopkg.in/ini.v1 v1.63.2
1819
k8s.io/api v0.23.0
1920
k8s.io/apimachinery v0.23.0
@@ -97,7 +98,6 @@ require (
9798
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
9899
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
99100
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
100-
golang.org/x/text v0.3.7 // indirect
101101
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
102102
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
103103
google.golang.org/appengine v1.6.7 // indirect

hack/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.16
55
require (
66
github.com/a8m/envsubst v1.2.0
77
github.com/golang/mock v1.6.0
8-
github.com/golangci/golangci-lint v1.43.0
8+
github.com/golangci/golangci-lint v1.45.2
99
github.com/itchyny/gojq v0.12.2
1010
github.com/onsi/ginkgo v1.16.4
1111
k8s.io/code-generator v0.22.2

hack/tools/go.sum

Lines changed: 225 additions & 102 deletions
Large diffs are not rendered by default.

pkg/record/recorder.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ limitations under the License.
1818
package record
1919

2020
import (
21-
"strings"
2221
"sync"
2322

23+
"golang.org/x/text/cases"
24+
"golang.org/x/text/language"
2425
corev1 "k8s.io/api/core/v1"
2526
"k8s.io/apimachinery/pkg/runtime"
2627
"k8s.io/client-go/tools/record"
@@ -45,20 +46,20 @@ func InitFromRecorder(recorder record.EventRecorder) {
4546

4647
// Event constructs an event from the given information and puts it in the queue for sending.
4748
func Event(object runtime.Object, reason, message string) {
48-
defaultRecorder.Event(object, corev1.EventTypeNormal, strings.Title(reason), message)
49+
defaultRecorder.Event(object, corev1.EventTypeNormal, cases.Title(language.English).String(reason), message)
4950
}
5051

5152
// Eventf is just like Event, but with Sprintf for the message field.
5253
func Eventf(object runtime.Object, reason, message string, args ...interface{}) {
53-
defaultRecorder.Eventf(object, corev1.EventTypeNormal, strings.Title(reason), message, args...)
54+
defaultRecorder.Eventf(object, corev1.EventTypeNormal, cases.Title(language.English).String(reason), message, args...)
5455
}
5556

5657
// Warn constructs a warning event from the given information and puts it in the queue for sending.
5758
func Warn(object runtime.Object, reason, message string) {
58-
defaultRecorder.Event(object, corev1.EventTypeWarning, strings.Title(reason), message)
59+
defaultRecorder.Event(object, corev1.EventTypeWarning, cases.Title(language.English).String(reason), message)
5960
}
6061

6162
// Warnf is just like Warn, but with Sprintf for the message field.
6263
func Warnf(object runtime.Object, reason, message string, args ...interface{}) {
63-
defaultRecorder.Eventf(object, corev1.EventTypeWarning, strings.Title(reason), message, args...)
64+
defaultRecorder.Eventf(object, corev1.EventTypeWarning, cases.Title(language.English).String(reason), message, args...)
6465
}

0 commit comments

Comments
 (0)