Skip to content

Commit 7361cbb

Browse files
authored
Merge pull request #1891 from saschagrunert/lint
Update golangci-lint and config
2 parents c06bcfc + b7c2770 commit 7361cbb

File tree

15 files changed

+34
-24
lines changed

15 files changed

+34
-24
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define curl_to
5252
endef
5353

5454
ZEITGEIST_VERSION = v0.5.3
55-
GOLANGCI_LINT_VERSION := v2.2.2
55+
GOLANGCI_LINT_VERSION := v2.4.0
5656
REPO_INFRA_VERSION = v0.2.5
5757

5858
GINKGO := $(BUILD_BIN_PATH)/ginkgo

cmd/crictl/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ func marshalContainerStatus(cs *pb.ContainerStatus) (string, error) {
11271127
return "", err
11281128
}
11291129

1130-
jsonMap := make(map[string]interface{})
1130+
jsonMap := make(map[string]any)
11311131

11321132
err = json.Unmarshal([]byte(statusStr), &jsonMap)
11331133
if err != nil {

cmd/crictl/sandbox.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func marshalPodSandboxStatus(ps *pb.PodSandboxStatus) (string, error) {
456456
return "", err
457457
}
458458

459-
jsonMap := make(map[string]interface{})
459+
jsonMap := make(map[string]any)
460460

461461
err = json.Unmarshal([]byte(statusStr), &jsonMap)
462462
if err != nil {

cmd/crictl/templates.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func builtinTmplFuncs() template.FuncMap {
4141
}
4242

4343
// jsonBuiltinTmplFunc allows to jsonify result of template execution.
44-
func jsonBuiltinTmplFunc(v interface{}) string {
44+
func jsonBuiltinTmplFunc(v any) string {
4545
o := new(bytes.Buffer)
4646

4747
enc := json.NewEncoder(o)
@@ -52,15 +52,15 @@ func jsonBuiltinTmplFunc(v interface{}) string {
5252
return o.String()
5353
}
5454

55-
// tmplExecuteRawJSON executes the template with interface{} with decoded by
55+
// tmplExecuteRawJSON executes the template with any with decoded by
5656
// rawJSON string.
5757
func tmplExecuteRawJSON(tmplStr, rawJSON string) (string, error) {
5858
dec := json.NewDecoder(
5959
bytes.NewReader([]byte(rawJSON)),
6060
)
6161
dec.UseNumber()
6262

63-
var raw interface{}
63+
var raw any
6464
if err := dec.Decode(&raw); err != nil {
6565
return "", fmt.Errorf("failed to decode json: %w", err)
6666
}

cmd/crictl/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func parseLabelStringSlice(ss []string) (map[string]string, error) {
489489

490490
// marshalMapInOrder marshals a map into JSON in the order of the original
491491
// data structure.
492-
func marshalMapInOrder(m map[string]interface{}, t interface{}) (string, error) {
492+
func marshalMapInOrder(m map[string]any, t any) (string, error) {
493493
s := "{"
494494

495495
v := reflect.ValueOf(t)

cmd/critest/cri_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func runParallelTestSuite(t *testing.T) {
170170
args = append(args, tempFileName, "--")
171171
args = append(args, testArgs...)
172172

173-
cmd := exec.Command("ginkgo", args...)
173+
cmd := exec.CommandContext(t.Context(), "ginkgo", args...)
174174
cmd.Stdout = os.Stdout
175175
cmd.Stderr = os.Stderr
176176

@@ -222,7 +222,7 @@ func generateGinkgoRunFlags() ([]string, error) {
222222
flags := ginkgotypes.SuiteConfigFlags
223223
flags = flags.CopyAppend(ginkgotypes.ReporterConfigFlags...)
224224

225-
bindings := map[string]interface{}{
225+
bindings := map[string]any{
226226
"S": &suiteConfig,
227227
"R": &reporterConfig,
228228
}

dependencies.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
match: ZEITGEIST_VERSION
2020

2121
- name: golangci-lint
22-
version: v2.2.2
22+
version: v2.4.0
2323
refPaths:
2424
- path: Makefile
2525
match: GOLANGCI_LINT_VERSION
@@ -35,3 +35,13 @@ dependencies:
3535
refPaths:
3636
- path: hack/release-notes.sh
3737
match: VERSION
38+
39+
- name: busybox
40+
version: 1.37.0
41+
refPaths:
42+
- path: images/image-test/Dockerfile
43+
match: FROM
44+
- path: images/image-user/Dockerfile
45+
match: FROM
46+
- path: images/image-predefined-group/Dockerfile
47+
match: FROM

images/build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ ARCHITECTURES=(
2626
arm64
2727
ppc64le
2828
s390x
29-
mips64le
3029
)
3130

3231
# Prepare the system

images/image-predefined-group/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM busybox:1.36.1
15+
FROM busybox:1.37.0
1616

1717
# User default-user(uid=1000) belongs to
1818
# group-defined-in-image(gid=50000) group in this image.

images/image-test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM busybox:1.36.1
15+
FROM busybox:1.37.0
1616
ARG TEST
1717
ADD ${TEST} ${TEST}

0 commit comments

Comments
 (0)