mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
ci: move to golangci-lint v1.57.2
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
parent
6bdd3acf73
commit
54f9d730e9
2
.github/workflows/lib-validate.yaml
vendored
2
.github/workflows/lib-validate.yaml
vendored
@ -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:
|
||||
|
@ -52,7 +52,7 @@ linters-settings:
|
||||
goconst:
|
||||
ignore-tests: true
|
||||
govet:
|
||||
check-shadowing: true
|
||||
shadow: true
|
||||
enable:
|
||||
- "fieldalignment"
|
||||
gocyclo:
|
||||
@ -65,3 +65,10 @@ issues:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- gocognit
|
||||
- wsl
|
||||
- path: test/e2e/
|
||||
linters:
|
||||
- wsl
|
||||
- path: cmd/gpu_fakedev/
|
||||
linters:
|
||||
- wsl
|
||||
|
2
Makefile
2
Makefile
@ -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
|
||||
|
@ -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
|
||||
@ -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())
|
||||
|
@ -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++
|
||||
}
|
||||
}
|
||||
|
@ -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++
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user