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
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v5
|
uses: golangci/golangci-lint-action@v5
|
||||||
with:
|
with:
|
||||||
version: v1.55.2
|
version: v1.57.2
|
||||||
args: -v --timeout 5m
|
args: -v --timeout 5m
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
@ -52,7 +52,7 @@ linters-settings:
|
|||||||
goconst:
|
goconst:
|
||||||
ignore-tests: true
|
ignore-tests: true
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
shadow: true
|
||||||
enable:
|
enable:
|
||||||
- "fieldalignment"
|
- "fieldalignment"
|
||||||
gocyclo:
|
gocyclo:
|
||||||
@ -65,3 +65,10 @@ issues:
|
|||||||
- path: _test\.go
|
- path: _test\.go
|
||||||
linters:
|
linters:
|
||||||
- gocognit
|
- 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
|
CERT_MANAGER_VERSION ?= v1.14.2
|
||||||
CONTROLLER_GEN_VERSION ?= v0.14.0
|
CONTROLLER_GEN_VERSION ?= v0.14.0
|
||||||
GOLANGCI_LINT_VERSION ?= v1.55.2
|
GOLANGCI_LINT_VERSION ?= v1.57.2
|
||||||
KIND_VERSION ?= v0.21.0
|
KIND_VERSION ?= v0.21.0
|
||||||
GOLICENSES_VERSION ?= v1.6.0
|
GOLICENSES_VERSION ?= v1.6.0
|
||||||
# Default bundle image tag
|
# 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")
|
return errors.Wrap(err, "can't create destination file")
|
||||||
}
|
}
|
||||||
defer dst.Close()
|
defer dst.Close()
|
||||||
|
|
||||||
_, err = io.Copy(dst, src)
|
_, err = io.Copy(dst, src)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
@ -170,6 +171,7 @@ func printBitstreamInfo(fname string, quiet bool) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer info.Close()
|
defer info.Close()
|
||||||
|
|
||||||
fmt.Printf("Bitstream file : %q\n", fname)
|
fmt.Printf("Bitstream file : %q\n", fname)
|
||||||
fmt.Printf("Interface UUID : %q\n", info.InterfaceUUID())
|
fmt.Printf("Interface UUID : %q\n", info.InterfaceUUID())
|
||||||
fmt.Printf("Accelerator Type UUID : %q\n", info.AcceleratorTypeUUID())
|
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)
|
klog.V(3).Infof("Cards for container nr %v in pod %v are %v", gpuUsingContainerIndex, getPodKey(pod), cards)
|
||||||
return cards
|
return cards
|
||||||
}
|
}
|
||||||
|
|
||||||
i++
|
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)
|
deviceInfo := dpapi.NewDeviceInfo(pluginapi.Healthy, devs, nil, envs, nil)
|
||||||
devTree.AddDevice(devType, fmt.Sprintf("%s_%s_%d", sname, ep.id, i), deviceInfo)
|
devTree.AddDevice(devType, fmt.Sprintf("%s_%s_%d", sname, ep.id, i), deviceInfo)
|
||||||
|
|
||||||
uniqID++
|
uniqID++
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,6 +217,7 @@ func (dp *DevicePlugin) parseConfigs(devices []device) (map[string]section, erro
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to parse device config")
|
return nil, errors.Wrap(err, "failed to parse device config")
|
||||||
}
|
}
|
||||||
|
|
||||||
devNum++
|
devNum++
|
||||||
|
|
||||||
for _, section := range config.Sections() {
|
for _, section := range config.Sections() {
|
||||||
|
@ -193,6 +193,7 @@ func (xms *xpuManagerSidecar) GetTopologyFromXPUMMetrics(data []byte) (topologyI
|
|||||||
value = *metric.Gauge.Value
|
value = *metric.Gauge.Value
|
||||||
} else if metric.Untyped != nil {
|
} else if metric.Untyped != nil {
|
||||||
klog.V(5).Info("metric is of type untyped")
|
klog.V(5).Info("metric is of type untyped")
|
||||||
|
|
||||||
value = *metric.Untyped.Value
|
value = *metric.Untyped.Value
|
||||||
} else {
|
} else {
|
||||||
klog.Warningf("Unknown/unsupported metric type: %v", metric)
|
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
|
containers := ds.Spec.Template.Spec.InitContainers
|
||||||
if len(containers) != 1 || containers[0].Image != dp.Spec.InitImage {
|
if len(containers) != 1 || containers[0].Image != dp.Spec.InitImage {
|
||||||
setInitContainer(&ds.Spec.Template.Spec, dp.Spec)
|
setInitContainer(&ds.Spec.Template.Spec, dp.Spec)
|
||||||
|
|
||||||
updated = true
|
updated = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,7 @@ func indexDaemonSets(ctx context.Context, mgr ctrl.Manager, apiGVString, pluginK
|
|||||||
// grab the DaemonSet object, extract the owner...
|
// grab the DaemonSet object, extract the owner...
|
||||||
ds := rawObj.(*apps.DaemonSet)
|
ds := rawObj.(*apps.DaemonSet)
|
||||||
owner := metav1.GetControllerOf(ds)
|
owner := metav1.GetControllerOf(ds)
|
||||||
|
|
||||||
if owner == nil {
|
if owner == nil {
|
||||||
return 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...
|
// grab the Pod object, extract the owner...
|
||||||
pod := rawObj.(*v1.Pod)
|
pod := rawObj.(*v1.Pod)
|
||||||
owner := metav1.GetControllerOf(pod)
|
owner := metav1.GetControllerOf(pod)
|
||||||
|
|
||||||
if owner == nil {
|
if owner == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,7 @@ func (c *controller) UpdateDaemonSet(rawObj client.Object, ds *apps.DaemonSet) (
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setInitContainer(&ds.Spec.Template.Spec, dp.Spec.InitImage)
|
setInitContainer(&ds.Spec.Template.Spec, dp.Spec.InitImage)
|
||||||
|
|
||||||
updated = true
|
updated = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user