Skip to content

Commit 54f9d73

Browse files
committed
ci: move to golangci-lint v1.57.2
Signed-off-by: Mikko Ylinen <[email protected]>
1 parent 6bdd3ac commit 54f9d73

File tree

10 files changed

+20
-3
lines changed

10 files changed

+20
-3
lines changed

.github/workflows/lib-validate.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: golangci-lint
4444
uses: golangci/golangci-lint-action@v5
4545
with:
46-
version: v1.55.2
46+
version: v1.57.2
4747
args: -v --timeout 5m
4848

4949
build:

.golangci.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ linters-settings:
5252
goconst:
5353
ignore-tests: true
5454
govet:
55-
check-shadowing: true
55+
shadow: true
5656
enable:
5757
- "fieldalignment"
5858
gocyclo:
@@ -65,3 +65,10 @@ issues:
6565
- path: _test\.go
6666
linters:
6767
- gocognit
68+
- wsl
69+
- path: test/e2e/
70+
linters:
71+
- wsl
72+
- path: cmd/gpu_fakedev/
73+
linters:
74+
- wsl

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""
1010

1111
CERT_MANAGER_VERSION ?= v1.14.2
1212
CONTROLLER_GEN_VERSION ?= v0.14.0
13-
GOLANGCI_LINT_VERSION ?= v1.55.2
13+
GOLANGCI_LINT_VERSION ?= v1.57.2
1414
KIND_VERSION ?= v0.21.0
1515
GOLICENSES_VERSION ?= v1.6.0
1616
# Default bundle image tag

cmd/fpga_tool/fpga_tool.go

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func installBitstream(fname string, dryRun, force, quiet bool) (err error) {
159159
return errors.Wrap(err, "can't create destination file")
160160
}
161161
defer dst.Close()
162+
162163
_, err = io.Copy(dst, src)
163164

164165
return err
@@ -170,6 +171,7 @@ func printBitstreamInfo(fname string, quiet bool) (err error) {
170171
return
171172
}
172173
defer info.Close()
174+
173175
fmt.Printf("Bitstream file : %q\n", fname)
174176
fmt.Printf("Interface UUID : %q\n", info.InterfaceUUID())
175177
fmt.Printf("Accelerator Type UUID : %q\n", info.AcceleratorTypeUUID())

cmd/gpu_plugin/rm/gpu_plugin_resource_manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ func containerCards(pod *v1.Pod, gpuUsingContainerIndex int) []string {
839839
klog.V(3).Infof("Cards for container nr %v in pod %v are %v", gpuUsingContainerIndex, getPodKey(pod), cards)
840840
return cards
841841
}
842+
842843
i++
843844
}
844845
}

cmd/qat_plugin/kerneldrv/kerneldrv.go

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func getDevTree(sysfs string, qatDevs []device, config map[string]section) (dpap
104104
}
105105
deviceInfo := dpapi.NewDeviceInfo(pluginapi.Healthy, devs, nil, envs, nil)
106106
devTree.AddDevice(devType, fmt.Sprintf("%s_%s_%d", sname, ep.id, i), deviceInfo)
107+
107108
uniqID++
108109
}
109110

@@ -216,6 +217,7 @@ func (dp *DevicePlugin) parseConfigs(devices []device) (map[string]section, erro
216217
if err != nil {
217218
return nil, errors.Wrap(err, "failed to parse device config")
218219
}
220+
219221
devNum++
220222

221223
for _, section := range config.Sections() {

cmd/xpumanager_sidecar/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ func (xms *xpuManagerSidecar) GetTopologyFromXPUMMetrics(data []byte) (topologyI
193193
value = *metric.Gauge.Value
194194
} else if metric.Untyped != nil {
195195
klog.V(5).Info("metric is of type untyped")
196+
196197
value = *metric.Untyped.Value
197198
} else {
198199
klog.Warningf("Unknown/unsupported metric type: %v", metric)

pkg/controllers/dlb/controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func (c *controller) UpdateDaemonSet(rawObj client.Object, ds *apps.DaemonSet) (
118118
containers := ds.Spec.Template.Spec.InitContainers
119119
if len(containers) != 1 || containers[0].Image != dp.Spec.InitImage {
120120
setInitContainer(&ds.Spec.Template.Spec, dp.Spec)
121+
121122
updated = true
122123
}
123124
}

pkg/controllers/reconciler.go

+2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ func indexDaemonSets(ctx context.Context, mgr ctrl.Manager, apiGVString, pluginK
300300
// grab the DaemonSet object, extract the owner...
301301
ds := rawObj.(*apps.DaemonSet)
302302
owner := metav1.GetControllerOf(ds)
303+
303304
if owner == nil {
304305
return nil
305306
}
@@ -320,6 +321,7 @@ func indexPods(ctx context.Context, mgr ctrl.Manager, apiGVString, pluginKind, o
320321
// grab the Pod object, extract the owner...
321322
pod := rawObj.(*v1.Pod)
322323
owner := metav1.GetControllerOf(pod)
324+
323325
if owner == nil {
324326
return nil
325327
}

pkg/controllers/sgx/controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func (c *controller) UpdateDaemonSet(rawObj client.Object, ds *apps.DaemonSet) (
167167
}
168168
} else {
169169
setInitContainer(&ds.Spec.Template.Spec, dp.Spec.InitImage)
170+
170171
updated = true
171172
}
172173

0 commit comments

Comments
 (0)