File tree 4 files changed +37
-30
lines changed
4 files changed +37
-30
lines changed Original file line number Diff line number Diff line change 21
21
E2E_SETUP_KUBECTL : yes
22
22
SUDO : sudo
23
23
GO_VERSION : " ^1.24"
24
- GOLANGCI_LINT_VERSION : " v1.64.6 "
24
+ GOLANGCI_LINT_VERSION : " v2.0.2 "
25
25
26
26
jobs :
27
27
ci-go-lint :
Original file line number Diff line number Diff line change 1
- run :
2
- timeout : 10m
3
-
1
+ version : " 2"
4
2
linters :
5
- disable-all : true
3
+ default : none
6
4
enable :
7
5
- gocritic
8
6
- gocyclo
9
- - gofmt
10
- - goimports
11
7
- gosec
12
- - gosimple
13
8
- govet
14
9
- ineffassign
15
10
- misspell
@@ -18,22 +13,34 @@ linters:
18
13
- staticcheck
19
14
- unconvert
20
15
- unused
21
-
22
- linters-settings :
23
- goimports :
24
- local-prefixes : k8s.io/kube-state-metrics,k8s.io/kube-state-metrics/v2
25
-
26
- issues :
27
- exclude-use-default : false
28
- exclude-rules :
29
- # We don't check metrics naming in the tests.
30
- - path : _test\.go
31
- linters :
32
- - promlinter
33
- # TODO(mrueg) Improve error handling
34
- - text : " G104:"
35
- linters :
36
- - gosec
37
- - text : " package-comments:"
38
- linters :
39
- - revive
16
+ exclusions :
17
+ generated : lax
18
+ rules :
19
+ - linters :
20
+ - promlinter
21
+ path : _test\.go
22
+ - linters :
23
+ - gosec
24
+ text : ' G104:'
25
+ - linters :
26
+ - revive
27
+ text : ' package-comments:'
28
+ paths :
29
+ - third_party$
30
+ - builtin$
31
+ - examples$
32
+ formatters :
33
+ enable :
34
+ - gofmt
35
+ - goimports
36
+ settings :
37
+ goimports :
38
+ local-prefixes :
39
+ - k8s.io/kube-state-metrics
40
+ - k8s.io/kube-state-metrics/v2
41
+ exclusions :
42
+ generated : lax
43
+ paths :
44
+ - third_party$
45
+ - builtin$
46
+ - examples$
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func TestSharding(t *testing.T) {
42
42
totalShards : 2 ,
43
43
}
44
44
45
- if ! ( s1 .keep (cm ) || s2 .keep (cm ) ) {
45
+ if ! s1 .keep (cm ) && ! s2 .keep (cm ) {
46
46
t .Fatal ("One shard must pick up the object." )
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ func (k *KSMClient) IsHealthz() (bool, error) {
118
118
119
119
func (k * KSMClient ) writeMetrics (endpoint * url.URL , w io.Writer ) error {
120
120
if endpoint == nil {
121
- return errors .New ("Endpoint is nil" )
121
+ return errors .New ("endpoint is nil" )
122
122
}
123
123
124
124
u := * endpoint
@@ -165,7 +165,7 @@ func (f *Framework) ParseMetrics(metrics func(io.Writer) error) (map[string]*dto
165
165
buf := & bytes.Buffer {}
166
166
err := metrics (buf )
167
167
if err != nil {
168
- return nil , fmt .Errorf ("Failed to get metrics: %w" , err )
168
+ return nil , fmt .Errorf ("failed to get metrics: %w" , err )
169
169
}
170
170
171
171
parser := & expfmt.TextParser {}
You can’t perform that action at this time.
0 commit comments