Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move to golangci-lint v1.57.2 #1720

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lib-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
version: v1.55.2
version: v1.57.2
args: -v --timeout 5m

build:
Expand Down
9 changes: 8 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ linters-settings:
goconst:
ignore-tests: true
govet:
check-shadowing: true
shadow: true
enable:
- "fieldalignment"
gocyclo:
Expand All @@ -65,3 +65,10 @@ issues:
- path: _test\.go
linters:
- gocognit
- wsl
- path: test/e2e/
linters:
- wsl
- path: cmd/gpu_fakedev/
linters:
- wsl
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""

CERT_MANAGER_VERSION ?= v1.14.2
CONTROLLER_GEN_VERSION ?= v0.14.0
GOLANGCI_LINT_VERSION ?= v1.55.2
GOLANGCI_LINT_VERSION ?= v1.57.2
KIND_VERSION ?= v0.21.0
GOLICENSES_VERSION ?= v1.6.0
# Default bundle image tag
Expand Down
2 changes: 2 additions & 0 deletions cmd/fpga_tool/fpga_tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func installBitstream(fname string, dryRun, force, quiet bool) (err error) {
return errors.Wrap(err, "can't create destination file")
}
defer dst.Close()

_, err = io.Copy(dst, src)

return err
Expand All @@ -170,6 +171,7 @@ func printBitstreamInfo(fname string, quiet bool) (err error) {
return
}
defer info.Close()

fmt.Printf("Bitstream file : %q\n", fname)
fmt.Printf("Interface UUID : %q\n", info.InterfaceUUID())
fmt.Printf("Accelerator Type UUID : %q\n", info.AcceleratorTypeUUID())
Expand Down
1 change: 1 addition & 0 deletions cmd/gpu_plugin/rm/gpu_plugin_resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ func containerCards(pod *v1.Pod, gpuUsingContainerIndex int) []string {
klog.V(3).Infof("Cards for container nr %v in pod %v are %v", gpuUsingContainerIndex, getPodKey(pod), cards)
return cards
}

i++
}
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/qat_plugin/kerneldrv/kerneldrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func getDevTree(sysfs string, qatDevs []device, config map[string]section) (dpap
}
deviceInfo := dpapi.NewDeviceInfo(pluginapi.Healthy, devs, nil, envs, nil)
devTree.AddDevice(devType, fmt.Sprintf("%s_%s_%d", sname, ep.id, i), deviceInfo)

uniqID++
}

Expand Down Expand Up @@ -216,6 +217,7 @@ func (dp *DevicePlugin) parseConfigs(devices []device) (map[string]section, erro
if err != nil {
return nil, errors.Wrap(err, "failed to parse device config")
}

devNum++

for _, section := range config.Sections() {
Expand Down
1 change: 1 addition & 0 deletions cmd/xpumanager_sidecar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (xms *xpuManagerSidecar) GetTopologyFromXPUMMetrics(data []byte) (topologyI
value = *metric.Gauge.Value
} else if metric.Untyped != nil {
klog.V(5).Info("metric is of type untyped")

value = *metric.Untyped.Value
} else {
klog.Warningf("Unknown/unsupported metric type: %v", metric)
Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/dlb/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (c *controller) UpdateDaemonSet(rawObj client.Object, ds *apps.DaemonSet) (
containers := ds.Spec.Template.Spec.InitContainers
if len(containers) != 1 || containers[0].Image != dp.Spec.InitImage {
setInitContainer(&ds.Spec.Template.Spec, dp.Spec)

updated = true
}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/controllers/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ func indexDaemonSets(ctx context.Context, mgr ctrl.Manager, apiGVString, pluginK
// grab the DaemonSet object, extract the owner...
ds := rawObj.(*apps.DaemonSet)
owner := metav1.GetControllerOf(ds)

if owner == nil {
return nil
}
Expand All @@ -320,6 +321,7 @@ func indexPods(ctx context.Context, mgr ctrl.Manager, apiGVString, pluginKind, o
// grab the Pod object, extract the owner...
pod := rawObj.(*v1.Pod)
owner := metav1.GetControllerOf(pod)

if owner == nil {
return nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/sgx/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (c *controller) UpdateDaemonSet(rawObj client.Object, ds *apps.DaemonSet) (
}
} else {
setInitContainer(&ds.Spec.Template.Spec, dp.Spec.InitImage)

updated = true
}

Expand Down